本文主要是介绍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日志中的。所以就会提示前文中的日志错误。
这篇关于The member contains transactions not present in the group. The member will now exit the group.的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!