mysql 1594_【MySQL】复制1594错误(从库relaylog损坏)

现象:

mysql> show slave status\G;

*************************** 1. row ***************************

-------------------------------------------------

Master_Log_File: mysql-bin.000191

Read_Master_Log_Pos: 334164088

Relay_Log_File: mysql-srelay.000533

Relay_Log_Pos: 902042386

Relay_Master_Log_File: mysql-bin.000190

Slave_IO_Running: Yes

Slave_SQL_Running: NoReplicate_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.

error_log如下:

160519 18:42:21 [ERROR] Error reading relay log event: Could not open log file

160519 18:42:21 [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 abl

e to know their names by issuing 'SHOW SLAVE STATUS' on this slave. Error_code: 1594

160519 18:42:21 [ERROR] Slave (additional info): File '/data/mysql3307/logs/mysql-srelay.030613' not found (Errcode: 2) Error_code: 29

160519 18:42:21 [Warning] Slave: File '/data/mysql3307/logs/mysql-srelay.030613' not found (Errcode: 2) Error_code: 29

160519 18:42:21 [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.009095' position 1069989357

解析:

从日志我们看出可能是master或者slave的binlog损坏或者网络问题

但是网络测过是正常的

然后stop slave,发现主库上的binlog继续增加,且没产生error_log

由此怀疑从库中继binlog损害

解决:

既然找出了原因,解决就相对容易了

1.从库执行reset slave,清除掉binlog日志

2.从出错前的位置开始启动复制

本例的复制位置为:

'mysql-bin.009095' position 1069989357

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/30221425/viewspace-2107638/,如需转载,请注明出处,否则将追究法律责任。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值