故障原因:
从库常见的错误如:
1、Could not execute Update_rows event on table tempdb.t1; Can't find record in 't1',Error_code: 1032; handler error HA_ERR_KEY_NOT_FOUND;the event's master log node233-binlog.000004, end_log_pos 476
(从库报找不到对应的被更新的记录Err no: 1032)
2、 Could not execute Delete_rows event on table tempdb.t1; Can't find record in 't1',Error_code: 1032; handler error HA_ERR_KEY_NOT_FOUND; the event's master log node233-binlog.000004, end_log_pos 5070
(从库找不到对应的被删除的记录Errno: 1032)
处理步骤:
1、stop slave;
2、reset master;
3、SET @@GLOBAL.GTID_PURGED='5cc28f3c-6a8d-11e4-beff-00163e5563d9:1-710050492';
不reset master会报错,是因为此时 gtid_executed,gtid_purged的值还保留在故障前的。如果重置事物的话会起冲突,系统会报错。
4、reset slave;
(不执行这一步 ,执行下面sql会报错 CHANGE MASTER cannot be executed when the slave was stopped with an error or killed in MTS mode. Consider using RESET SLAVE or START SLAVE UNTIL.)
5、change master to master_host='XXX.XXX.XXX.XXX',master_user='user',master_password='pass',master_auto_position=1;
6、start slave;
7、show slave status\G
您还未添加分享代码,请到主题选项中,添加百度分享代码!
您可以选择一种方式赞助本站
支付宝转账赞助
支付宝扫一扫赞助
微信钱包扫描赞助