mysql主从err日志_解决mysql集群报"handler error HA_ERR_KEY_NOT_FOUND...end_log_pos 402, Error_code: 1032"造成主从无...

一、异常说明

在安装mysql主从cluster集群时报"[ERROR] Slave SQL for channel : Could not execute Delete_rows event on table mytest.tb_test; Can't find record in 'tb_test', Error_code: 1032; handler error HA_ERR_KEY_NOT_FOUND; the event's master log mysql-bin.000006, end_log_pos 402, Error_code: 1032"异常提醒,造成主服务器master新增内容无法正常同步到slave机上,详情如下>>2019-05-14T12:56:00.409855Z 10 [ERROR] Slave SQL for channel '': Could not execute Delete_rows event on table mytest.tb_test; Can't find record in 'tb_test', Error_code: 1032; handler error HA_ERR_KEY_NOT_FOUND; the event's master log mysql-bin.000006, end_log_pos 402, Error_code: 1032@b@2019-05-14T12:56:00.409863Z 10 [Warning] Slave: Can't find record in 'tb_test' Error_code: 1032@b@2019-05-14T12:56:00.409866Z 10 [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.000006' position 154.

二、解决方法

方法一、该异常时由于mysql slave备机不存在该记录,但是主机master删除时无需报1032错误,可以通过my.cnf可配置slave-skip-errors=1032 从而跳过日志中1032 ERROR报错[root@centos-cluster-s19423 ~]# vi  /etc/my.cnf@b@...@b@slave-skip-errors=1032

方法二、登录到mysql进行set global sql_slave_skip_counter=1;  具体如下[root@centos-cluster-s19423 ~]# mysql  -uroot  -p123456;@b@mysql: [Warning] Using a password on the command line interface can be insecure.@b@Welcome to the MySQL monitor.  Commands end with ; or \g.@b@Your MySQL connection id is 5@b@Server version: 5.7.26-log MySQL Community Server (GPL)@b@@b@Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.@b@@b@Oracle is a registered trademark of Oracle Corporation and/or its@b@affiliates. Other names may be trademarks of their respective@b@owners.@b@@b@Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.@b@@b@mysql> set global sql_slave_skip_counter=1;  @b@Query OK, 0 rows affected (0.00 sec)@b@@b@mysql> stop slave; @b@Query OK, 0 rows affected (0.02 sec)@b@@b@mysql> start slave;@b@Query OK, 0 rows affected (0.00 sec)

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

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值