Mysql从二进制日志读取数据时从master出错1236

2023-12-27

我有 2 个具有主/从配置的 MySql,并且复制失败。 MySql Master崩溃了,新的寄存器在mysql-bin.index被创建。我删除了这个新的寄存器,因为文件系统中不存在该文件。然后MySql Master重启成功。

现在,我在从站中出现了下一个错误:

mysql> show slave status \G
*************************** 1. row ***************************
           Slave_IO_State: 
              Master_Host: 10.64.253.99
              Master_User: replication
              Master_Port: 3306
            Connect_Retry: 60
          Master_Log_File: mysql-bin.001050
      Read_Master_Log_Pos: 54868051
           Relay_Log_File: mysqld-relay-bin.000001
            Relay_Log_Pos: 4
    Relay_Master_Log_File: mysql-bin.001050
         Slave_IO_Running: No
        Slave_SQL_Running: Yes
          Replicate_Do_DB: 
      Replicate_Ignore_DB: 
       Replicate_Do_Table: 
   Replicate_Ignore_Table: 
  Replicate_Wild_Do_Table: 
Replicate_Wild_Ignore_Table: 
               Last_Errno: 0
               Last_Error: 
             Skip_Counter: 0
      Exec_Master_Log_Pos: 54868051
          Relay_Log_Space: 107
          Until_Condition: None
           Until_Log_File: 
            Until_Log_Pos: 0
       Master_SSL_Allowed: No
       Master_SSL_CA_File: 
       Master_SSL_CA_Path: 
          Master_SSL_Cert: 
        Master_SSL_Cipher: 
           Master_SSL_Key: 
    Seconds_Behind_Master: NULL
Master_SSL_Verify_Server_Cert: No
            Last_IO_Errno: 1236
            Last_IO_Error: Got fatal error 1236 from master when reading data from binary log: 'Could not find first log file name in binary log index file'
           Last_SQL_Errno: 0
           Last_SQL_Error: 
Replicate_Ignore_Server_Ids: 
         Master_Server_Id: 1

如果我执行“show master status”来查看mysql bin日志文件和位置:

mysql> show master status \G
*************************** 1. row ***************************
            File: mysql-bin.001050
        Position: 55586895
    Binlog_Do_DB: aaa
 Binlog_Ignore_DB: xxx,yyy,zzz,mysql

然后我为从站设置新配置:

STOP SLAVE;
CHANGE MASTER TO 
    MASTER_HOST='10.64.253.99',
    MASTER_USER='slaveUser',
    MASTER_PASSWORD='12345',
    MASTER_LOG_FILE='mysql-bin.001050', 
    MASTER_LOG_POS=55586895;
START SLAVE;

如果我再次检查从属状态,则会出现相同的错误:

mysql> show slave status \G
*************************** 1. row ***************************
           Slave_IO_State: 
              Master_Host: 10.64.253.99
              Master_User: replication
              Master_Port: 3306
            Connect_Retry: 60
          Master_Log_File: mysql-bin.001050
      Read_Master_Log_Pos: 55586895
           Relay_Log_File: mysqld-relay-bin.000001
            Relay_Log_Pos: 4
    Relay_Master_Log_File: mysql-bin.001050
         Slave_IO_Running: No
        Slave_SQL_Running: Yes
          Replicate_Do_DB: 
      Replicate_Ignore_DB: 
       Replicate_Do_Table: 
   Replicate_Ignore_Table: 
  Replicate_Wild_Do_Table: 
Replicate_Wild_Ignore_Table: 
               Last_Errno: 0
               Last_Error: 
             Skip_Counter: 0
      Exec_Master_Log_Pos: 55586895
          Relay_Log_Space: 107
          Until_Condition: None
           Until_Log_File: 
            Until_Log_Pos: 0
       Master_SSL_Allowed: No
       Master_SSL_CA_File: 
       Master_SSL_CA_Path: 
          Master_SSL_Cert: 
        Master_SSL_Cipher: 
           Master_SSL_Key: 
    Seconds_Behind_Master: NULL
Master_SSL_Verify_Server_Cert: No
            Last_IO_Errno: 1236
            Last_IO_Error: Got fatal error 1236 from master when reading data from binary log: 'Could not find first log file name in binary log index file'
           Last_SQL_Errno: 0
           Last_SQL_Error: 
 Replicate_Ignore_Server_Ids: 
         Master_Server_Id: 1

我已经在MySql Master中检查过mysql-bin.001050存在并且不为空。

这是生产环境,每分钟都会插入新数据。位置值可以在分钟或秒内改变。我不知道这是否是一个问题。

max_allowed_pa​​cket变量在两个MySql中具有相同的值(16M)。

为什么slave找不到二进制日志文件?


你可以试试这个:

  1. Slave: stop slave;
  2. Master: flush logs
  3. Master: show master status; — take note of the master log file and master log position

  4. Slave: CHANGE MASTER TO MASTER_LOG_FILE='log-bin.00000X', MASTER_LOG_POS=106;

  5. Slave: start slave;
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Mysql从二进制日志读取数据时从master出错1236 的相关文章

  • SQL UPDATE 语句根据另一个现有行更新列

    基本上我有一个与下表具有相似格式的表格 我想做的是根据这个逻辑更新 Col4 如果 Col2 为空 则用 Col3 更新 Col4 如果 Col2 不为 null 则在 Col1 中查找与 Col2 中的值匹配的值 使用 col3 中的相应
  • 删除表的重复项

    In my activity logs 它包含列 material name user id mod result 这标志着测试是否通过 失败 cert links 不知何故 用户生成了两倍的条目material name与cert lin
  • 在 Mysql 上使用 EntityManager JPA 运行脚本

    我正在尝试运行脚本 sql 文件 但由于我尝试了多种方法 因此出现多个错误 这是我的主要 sql 脚本 INSERT INTO Unity VALUES 11 paq 0 2013 04 15 11 41 37 Admin Paquete
  • 自动删除主键序列中的间隙

    我正在创建一个网页 该网页根据用户操作将数据存储到 MySQL 数据库中 数据库有很多行 行的主键是列 rowID 它只是按顺序对行进行编号 例如 1 2 3 4 用户可以选择删除行 问题是当用户删除最后一行以外的行时 rowID 中有一个
  • 本地 Postgres 实例和 Azure Cloud Postgres 实例之间的实时同步

    我需要在本地 postgresql 实例与云 postgresql 实例之间设置实时同步过程 请让我知道我可以通过哪些选项来实现它 我是否必须使用任何特定工具或者可以通过复制进行管理 请指教 使用 PgPool http www pgpoo
  • 尝试在 React 应用程序中连接到 MySQL 数据库时,无法读取未定义的属性(读取“查询”)错误

    我正在尝试连接到 MySQL 数据库并在单击按钮后在 React 应用程序中运行查询 一些它如何给出错误 我当前的代码如下所示 import mysql from mysql function App async function sync
  • 如何在 codeigniter 查询中使用 FIND_IN_SET?

    array array classesID gt 6 this gt db gt select gt from this gt table name gt where array gt order by this gt order by q
  • 一个表可以有多个主键吗?

    我现在很困惑 也许你可以帮助我更好地理解这个问题 即一个表可以有两个主键 如果是 那么如何 如果没有 那为什么 您询问是否可以有多个主键field你当然可以 您只能有一个主键 但它可以包含唯一标识行所需的任意数量的列 创建表时使用类似这样的
  • 如何导出带有数据的 MySQL 架构?

    我有一个完整的架构 其中有许多表 其中包含 MySQL 查询浏览器中的数据 现在我想将这个包含所有表 数据的完整数据库发送给我的同事 我怎样才能将其发送给我的同事 以便他可以将这个完整的架构放入他的 MySQL 查询浏览器中 Thanks
  • pymongo复制辅助读取引用不起作用

    我们有 MongoDB 2 6 和 2 副本集 并且我们使用pymongo驱动程序并使用以下 url 连接 Mongodb 副本集 mongodb admin email protected cdn cgi l email protecti
  • MySQL 数据库无法在 XAMPP for Mac 上启动

    突然我在 mac 上遇到了这个问题 我无法启动我的 MySQL 数据库 我只能启动 ProFTPD 和 Apache Web Server 这是应用程序日志 Starting all servers Starting MySQL Datab
  • 在 django ORM 中查询时如何将 char 转换为整数?

    最近开始使用 Django ORM 我想执行这个查询 select student id from students where student id like 97318 order by CAST student id as UNSIG
  • MySQL 将表从 Latin1 转换为 utf8

    我需要将包含大量数据的表从 Latin1 转换为 utf8 以便它可以接受韩语字符 如何更改该表而不损坏其中的数据 我的 SQL 语句是什么 最好的方法是什么 ALTER TABLE database name table name CON
  • 如何为我的整个 Node.js 应用程序使用相同的 MySQL 连接?

    我有一个app js 我从那里运行我的整个应用程序 在 app js 内部 我require许多文件中都有代码 对于每个文件 我都这样做 var mysql require mysql var mclient mysql createCon
  • PDO语法错误

    我在一个项目中使用 PDO 但提交时出现语法错误 这是我的代码
  • MySQL 可选的带有 MATCH 的 LEFT JOIN

    我有以下查询 它对 MySQL Innodb 数据库中同一搜索词的两个不同表中的两列执行全文搜索 SELECT Id MATCH tb1 comment tb2 comment AGAINST search term IN BOOLEAN
  • 获取mysql中逗号分隔行中不同值的计数

    一个表 Jobs 有 2 列 JobId 城市 当我们保存工作时 工作位置可能是多个城市 如下所示 JobId City 1 New York 2 New York Ohio Virginia 3 New York Virginia 我如何
  • 连接到 OpenShift (Redhat Paas) mysql 实例

    我正在尝试将我的 C 应用程序与 openshift 数据库连接 但我得到了这个例外conn Open Eccezione gt MySql Data MySqlClient MySqlException 0x80004005 Unable
  • MySQL JOIN 滥用?情况会变得有多糟糕?

    我读了很多关于关系数据库的文章 在每个 SELECT 上使用许多 JOIN 语句 但是 我一直想知道滥用这种方法从长远来看是否会出现任何性能问题 例如 假设我们有一个users桌子 我通常会添加 最常用 的数据 而不是进行任何额外的联接 例
  • 使用 MYSQL 将 h:mm pm/am 时间格式插入数据库

    我正在尝试将以 h mm am pm 格式写入的时间插入到存储为标准 DATETIME 格式 hh mm ss 的数据库中 但我不知道如何将发布的时间转换为标准格式所以数据库会接受它 这是我到目前为止一直在尝试的 title POST in

随机推荐