The member contains transactions not present in the group. The member will now exit the group.

根据官方文档做MySQL 5.7.21 Group Replication Demo,单主模式,启动单主MySQL是没有问题的。但是将其他MySQL加入到组中时,会报一下错误:

2018-11-06T17:09:18.179649+08:00 0 [ERROR] Plugin group_replication reported: 'This member has more executed transactions than those present in the group. Local transactions: 10af2176-e1a1-11e8-8e7a-005056276481:1-2 > Group transactions: c26202a4-dcdf-11e8-906b-000c29b52535:1-5'
2018-11-06T17:09:18.179807+08:00 0 [ERROR] Plugin group_replication reported: 'The member contains transactions not present in the group. The member will now exit the group.'
2018-11-06T17:09:18.179834+08:00 0 [Note] Plugin group_replication reported: 'To force this member into the group you can use the group_replication_allow_local_disjoint_gtids_join option'
2018-11-06T17:09:18.179943+08:00 0 [Note] Plugin group_replication reported: 'Group membership changed to node3:3306, node1:3306, node2:3306 on view 15414849130604638:3.'
2018-11-06T17:09:18.180021+08:00 2 [Note] Plugin group_replication reported: 'Going to wait for view modification'
2018-11-06T17:09:21.520018+08:00 0 [Note] Plugin group_replication reported: 'Group membership changed: This member has left the group.'
2018-11-06T17:09:26.521270+08:00 2 [Note] Plugin group_replication reported: 'auto_increment_increment is reset to 1'
2018-11-06T17:09:26.521457+08:00 2 [Note] Plugin group_replication reported: 'auto_increment_offset is reset to 1'
2018-11-06T17:09:26.521885+08:00 7 [Note] Error reading relay log event for channel 'group_replication_applier': slave SQL thread was killed
2018-11-06T17:09:26.523301+08:00 7 [Note] Slave SQL thread for channel 'group_replication_applier' exiting, replication stopped in log 'FIRST' at position 0
2018-11-06T17:09:26.525881+08:00 4 [Note] Plugin group_replication reported: 'The group replication applier thread was killed'

看网上很多童鞋是根据日志信息将此变量置为:set global group_replication_allow_local_disjoint_gtids_join=ON;但是根据官方文档描述

Deprecated in version 5.7.21 and scheduled for removal in a future version. Allow the current server to join the group even if it has transactions not present in the group.

该变量已经不推荐使用了。

经过一番不懈努力,终于在官方论坛找到了答案。

出现此问题时,在MySQL中执行

RESET MASTER

此命令据官方文档描述,含义为

RESET MASTER enables you to delete any binary log files and their related binary log index file, returning the master to its state before binary logging was started.

然后再把组复制的命令配置一遍就OK了。

出现这个现象的原因:

  • MySQL是新装的没问题,但是每次新装MySQL都要修改密码,如果在修改密码的时候就已经把binlog_format=on配在了/etc/my.cnf中,那么修改密码的记录是存在在binlog日志中的。所以就会提示前文中的日志错误。
  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 4
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值