加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长学院 > MySql教程 > 正文

mysql主从不同步,提示LastMysql应用

发布时间:2020-12-12 00:50:15 所属栏目:MySql教程 来源:网络整理
导读:《mysql主从不同步,提示LastMysql应用》要点: 本文介绍了mysql主从不同步,提示LastMysql应用,希望对您有用。如果有疑问,可以联系我们。 导读:从库原文提示:Last_Error: Coordinator stopped because there were error(s) in the worker(s). The most

《mysql主从不同步,提示LastMysql应用》要点:
本文介绍了mysql主从不同步,提示LastMysql应用,希望对您有用。如果有疑问,可以联系我们。

导读:从库原文提示:Last_Error: Coordinator stopped because there were error(s) in the worker(s). The most recent failure being: Worker 1 failed executing transaction 查看丛库状态show slave statusG

从库原文提示:Last_Error: Coordinator stopped because there were error(s) in the worker(s). The most recent failure being: Worker 1 failed executing transaction '864e6992-0a34-11e7-a98a-7cd30ac6c9ec:148408' at master log mysql-bin.000010,end_log_pos 920578920. See error log and/or performance_schema.replication_applier_status_by_worker table for more details about this failure or others,if any.MYSQL数据库

mysql主从不同步,提示Last_Error: Coordinator stopped because there were error(s) in the worker(s). The most recent failure being: Worker 1 failed executing transaction

MYSQL数据库

1、? 按照丛库的提示找原因,输入命令MYSQL数据库

select * from performance_schema.replication_applier_status_by_workerGMYSQL数据库

得到MYSQL数据库

MYSQL数据库

知道这个事务发生在表 r_com_patent 上,定位到表,但是不知道哪一条记录.MYSQL数据库

2、? 到主库找二进制文件发生了什么事.输入命令MYSQL数据库

Mysqlbinlog --no-defaults –v –v --base64-output=decode-rows /usr/local/mysql/data/master-bin.000010 | grep –A ‘10’ 920578920MYSQL数据库

?

mysql主从不同步,提示Last_Error: Coordinator stopped because there were error(s) in the worker(s). The most recent failure being: Worker 1 failed executing transaction

MYSQL数据库

?MYSQL数据库

终于定位到记录了.MYSQL数据库

主库在表r_com_patent做了更新操作,而丛库找不到更新的记录.MYSQL数据库

具体来说就是,主库将表r_com_patent中patent_id为45的记录,字段cid从NULL更改为3253026.而丛库表r_com_patent中patent_id为45的记录,字段cid原本为3253026,由于复制机制就必须找丛库表r_com_patent中patent_id为45并且id为NULL的记录,所以没找到...MYSQL数据库

3、? 解决方法MYSQL数据库

1)???????? 在master查看那条记录.MYSQL数据库

Select * from r_com_patent where patent_id = 45;MYSQL数据库

2)???????? 在slave上,查找下更新后的那条记录,应该是不存在的.MYSQL数据库

    Select * from r_com_patent where patent_id = 45;MYSQL数据库

3)???????? 把丢失的数据在Slave上填补或是修改.MYSQL数据库

    Insert into r_com_patent values(3253026,45);MYSQL数据库

4)???????? 在slave跳过报错的事务.MYSQL数据库

Stop slave;MYSQL数据库

Set @@SESSION.GTID_NEXT=’ 864e6992-0a34-11e7-a98a-7cd30ac6c9ec:148408’MYSQL数据库

Begin;MYSQL数据库

Commit;MYSQL数据库

Set @@SESSION.GTID_NEXT = AUTOMATIC;MYSQL数据库

Start slave;MYSQL数据库

之后,再检查一遍MYSQL数据库

  Show slave statusGMYSQL数据库

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读