Relay log read failure的处理

MySQL支持 2009-11-30 09:09:31 累计浏览 2,675 次
       众所周知MySQL5.1的Replication是比较烂的。MySQL的每一个版本更新关于同步方面每次都是可以看到一大堆。但MySQL 5.1性能是比较突出的。所以经不住诱惑使用MySQL 5.1。所以也要经常遇到一些Bug。如: 
mysql> show slave status\G 
*************************** 1. row *************************** 
               Slave_IO_State: Waiting for master to send event 
                  Master_Host: 192.168.10.118 
                  Master_User: repl_wu 
                  Master_Port: 3306 
                Connect_Retry: 30 
              Master_Log_File: mysql-bin.005121 
          Read_Master_Log_Pos: 64337286 
               Relay_Log_File: relay-bin.003995 
                Relay_Log_Pos: 18446697137031827760 
        Relay_Master_Log_File: mysql-bin.005121 
             Slave_IO_Running: Yes 
            Slave_SQL_Running: No 
              Replicate_Do_DB: 
          Replicate_Ignore_DB: 
           Replicate_Do_Table: 
       Replicate_Ignore_Table: 
      Replicate_Wild_Do_Table: 
  Replicate_Wild_Ignore_Table: 
                   Last_Errno: 1594 
                   Last_Error: Relay log read failure: Could not parse relay log event entry. The possible reasons are: the master’s binary log is corrupted (you can check this by running ’mysqlbinlog’ on the binary log), the slave’s relay log is corrupted (you can check this by running ’mysqlbinlog’ on the relay log), a network problem, or a bug in the master’s or slave’s MySQL code. If you want to check the master’s binary log or slave’s relay log, you will be able to know their names by issuing ’SHOW SLAVE STATUS’ on this slave. 
                 Skip_Counter: 0 
          Exec_Master_Log_Pos: 4 
              Relay_Log_Space: 64337901 
              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: 0 
                Last_IO_Error: 
               Last_SQL_Errno: 1594 
               Last_SQL_Error: Relay log read failure: Could not parse relay log event entry. The possible reasons are: the master’s binary log is corrupted (you can check this by running ’mysqlbinlog’ on the binary log), the slave’s relay log is corrupted (you can check this by running ’mysqlbinlog’ on the relay log), a network problem, or a bug in the master’s or slave’s MySQL code. If you want to check the master’s binary log or slave’s relay log, you will be able to know their names by issuing ’SHOW SLAVE STATUS’ on this slave. 
1 row in set (0.00 sec) 

        从上面可以看到是中继日值或是Master上的日值出问题了。
        首先如果是中继日值坏掉,那只需要找到同步的时间点,然后重新同步,这样就可以有新的中继日值了。如果Master上的日值坏了就麻烦了。
从经验来看,这是中继日值出问题了。处理方法:

    需要找到同步的点。

日值为:Master_Log_File: mysql-bin.005121,Relay_Master_Log_File: mysql-bin.005121以Relay_Master_Log_File为准,Master_Log_File为参考。

日值执行时间点:

Exec_Master_Log_Pos: 4

那么现在就可以:

   
      mysql>stop slave; 
  
    mysql>change master to Master_Log_File=’mysql-bin.005121’, Master_Log_Pos=4; 
    
    mysql>start slave; 
  
    mysql>show slave status\G;

    进行确认。

   建议:

    在使用MySQL-5.1.36以下的版本的同学,请尽快升级到MySQL-5.1.40 & MySQL-5.1.37sp1

同分类推荐文章

  1. 国产数据库迁移:真正花时间的从来不是搬数据 (2026-11-14 04:10:02)
  2. 由于con$.con#值达到极限,触发数据库增加约束报ORA-600 12807错误 (2026-11-14 03:40:02)
  3. MongoDB 离线提取工具—mongoext (2026-11-13 18:10:02)

查看更多 数据库 文章 →

建议继续学习

  1. 用Hyer来进行网站的抓取 (累计阅读 158,836)
  2. MySQL数据库在实际应用一些方面的介绍 (累计阅读 36,807)
  3. WordPress插件开发 -- 在插件使用数据库存储数据 (累计阅读 29,567)
  4. Mysql监控指南 (累计阅读 21,828)
  5. 由浅入深探究mysql索引结构原理、性能分析与优化 (累计阅读 17,049)
  6. 在Apache2.2.XX下安装Mod-myvhost模块 (累计阅读 13,479)
  7. 15个最好的免费开源电子商务平台 (累计阅读 12,947)
  8. 浅谈MySQL索引背后的数据结构及算法 (累计阅读 12,688)
  9. 整理了一份招PHP高级工程师的面试题 (累计阅读 12,219)
  10. 深入浅出INNODB MVCC机制与原理 (累计阅读 10,000)