现在的位置: 首页 > 综合 > 正文

处理 Could not parse relay log event entry

2013年12月03日 ⁄ 综合 ⁄ 共 2918字 ⁄ 字号 评论关闭

[编辑

]

Slave停止
工作

[编辑

]

无法读取
master上的log

  • 现象1
show slave status显示以下错误信息
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. Error_code: 0
  • 原因

    • 在传输master log-bin时,因网络原因或slave机压力问题,造成log-relay文件格式错误
  • 解决
    1. 找到relay-log.info,第一行记录了当前正在执行的log-relay文件名
    2. 找到该文件的下一个文件
    3. 使用mysqlbinlog查看该文件,在#98这行有Rotate to log-bin.000004 pos:
      4等信息,这就是目前slave停止的位置
    4. 在slave上重新指定同步位置,方法见CHANGE MASTER TO

步骤:

#>show slave status/G

***************************
1. row ***************************
             Slave_IO_State:
Waiting for master to send event
                Master_Host:
xx.xxx.218
                Master_User: fbrep
               
Master_Port: 3306
              Connect_Retry: 60
           
Master_Log_File: fb-bin.000092
        Read_Master_Log_Pos: 656277404
            
Relay_Log_File: fb-relay.000356
              Relay_Log_Pos:
581305814
      Relay_Master_Log_File: fb-bin.000092
          
Slave_IO_Running: Yes
          Slave_SQL_Running: No
           
Replicate_Do_DB: fb,fb
        Replicate_Ignore_DB:
        
Replicate_Do_Table:
     Replicate_Ignore_Table:
   
Replicate_Wild_Do_Table:
Replicate_Wild_Ignore_Table:
                
Last_Errno: 0
                 Last_Error: 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: 1
        Exec_Master_Log_Pos: 131
           
Relay_Log_Space: 656280278
            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.info 及relay.info

cat master.info   ##
14
fb-bin.000092
657927031
xx.xx.44.218
fbrep
4rep0u1y
3306
60
0
##
[root@TJSJHL212-128
message2.kdb var]# cat relay-log.info
./fb-relay.000356
581305814
fb-bin.000092
131
05549
5
##
# mysqlbinlog fb-relay.000357 | more


/*!40019
SET @@session.max_insert_delayed_threads=0*/;
/*!50003 SET
@OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
# at 4
#100412
15:50:58 server id 200128 end_log_pos 98       Start: binlog v 4,
server v 5.0.27-standard-log created 100412 15:50:58
# at 98
#700101 8:00:00 server id 16218 end_log_pos
0         Rotate to fb-bin.000092 pos: 581305707


#
change master:

change master to
master_host='xx.xx.218',MASTER_USER='xx',MASTER_PASSWORD='xx',
   
->
master_port=3306,MASTER_LOG_FILE='fb-bin.000092',MASTER_LOG_POS=581305707;

抱歉!评论已关闭.