Last_Error: Relay log read failure: Could not parse relay log event entry.

綜合網上各種答案,總結一下,還是有幫助的。


Relay log corruption example:

You can get error info after SHOW SLAVE STATUS;

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.

In most cases, it should be caused by a network problem which leads to a corruption of relay log. And this problem can be fixed quite easily. So when you get error, first try this to see if it works.
1. stop the slave and get info by "SHOW SLAVE STATUS;"

2. Note down values of these two fields: "Relay_Master_Log_File","Exec_Master_Log_Pos"

For example>Relay_Master_Log_File=mysql-bin.000287>Exec_Master_Log_Pos: 972239835

3. Bypass the corrupted relay log by

mysql> CHANGE MASTER TO
mysql> MASTER_LOG_FILE='mysql-bin.000287',
mysql> MASTER_LOG_POS=972239835;
mysql> START SLAVE;

補充:主要是沒有同步,MASTER_LOG_FILE,MASTER_LOG_POS設置成master上顯示的值(master服務器上執行show master status;查看)。

Master_Log_File: mysql-bin.005121,Relay_Master_Log_File: mysql-bin.005121以Relay_Master_Log_File爲準,Master_Log_File爲參考。

參考自鏈接:http://www.cnblogs.com/niniwzw/archive/2010/02/04/1663685.html

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章