⼀次mysqlslave故障的解决过程
mysql> show slave status\G
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. Error_code: 1594
看样⼦,应该由于⽹络原因 slave relay log损坏了
查看 mysql ⽇志:
170306 12:34:08 [Note] Slave SQL thread initialized, starting replication in log ‘mysql-bin.000033’ at position 77270703, relay log ‘./HK3ASERVER-relay-bin.066281’ position: 10604437
170306 12:34:08 [ERROR] Error in Log_event::read_log_event(): ‘read error’, data_len: 67, event_type: 19
170306 12:34:08 [ERROR] Error reading relay log event: slave SQL thread aborted because of I/O error
170306 12:34:08 [ERROR] Slave SQL: 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. Error_code: 1594
170306 12:34:08 [ERROR] Error running query, slave SQL thread aborted. Fix the problem, and restart the slave SQL thread with “SLAVE START”. We stopped at log ‘mysql-bin.000033’ position 77270703
mysql> stop slave;
mysql> change master to Master_Log_File=’mysql-bin.000033’, Master_Log_Pos=77270703;
This operation cannot be performed with a running slave; run STOP SLAVE first
mysql> show slave status\G
发现IO_THREAD线程⼀直存在停不掉
最后,将mysql/data⽬录下的 master.info 备⾛,重新启动 mysql
mysql> show slave status\G
发现 slave 已彻底停掉了
mysql> reset slave;
mysql> change master to Master_Log_File=’mysql-bin.000033’, Master_Log_Pos=77270703;
mysql> start slave;
Slave_IO_Running: Yes
mysql下载starting the serverSlave_SQL_Running: Yes
slave 恢复正常

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。