tony 发表于 2024-3-20 22:05:47

求助:部署单主MGR集群,第二个实例无法加入集群报错

本帖最后由 tony 于 2024-3-21 14:09 编辑

第一个节点部署成功
mysql> select * from performance_schema.replication_group_members;
+---------------------------+--------------------------------------+-------------+-------------+--------------+-------------+----------------+----------------------------+
| CHANNEL_NAME            | MEMBER_ID                            | MEMBER_HOST | MEMBER_PORT | MEMBER_STATE | MEMBER_ROLE | MEMBER_VERSION | MEMBER_COMMUNICATION_STACK |
+---------------------------+--------------------------------------+-------------+-------------+--------------+-------------+----------------+----------------------------+
| group_replication_applier | 2b5c6540-e5d0-11ee-8376-000c29ec4ae4 | mgr01       |      3306 | ONLINE       | PRIMARY   | 8.0.35         | XCom                     |
+---------------------------+--------------------------------------+-------------+-------------+--------------+-------------+----------------+----------------------------+
1 row in set (0.00 sec)第二个节点加入集群报错
mysql> START GROUP_REPLICATION;
ERROR 3092 (HY000): The server is not configured properly to be an active member of the group. Please see more details on error log.报错日志如下
2024-03-20T21:16:28.301465+08:00 0 Plugin group_replication reported: 'This member has more executed transactions than those present in the group. Local transactions: f4343bed-e68a-11ee-9d06-000c293b6e72:1-4 > Group transactions: 2b5c6540-e5d0-11ee-8376-000c29ec4ae4:1-8, aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1-4'
2024-03-20T21:16:28.301534+08:00 0 Plugin group_replication reported: 'The member contains transactions not present in the group. The member will now exit the group.'
2024-03-20T21:16:28.301580+08:00 0 Plugin group_replication reported: 'Group membership changed to mgr01:3306, mgr02:3306 on view 17109245818795019:2.'
2024-03-20T21:16:31.371530+08:00 0 Plugin group_replication reported: 'Group membership changed: This member has left the group.'
2024-03-20T21:16:31.373589+08:00 11 Plugin group_replication reported: 'Setting super_read_only=OFF.'请问各位大佬有哪些解决方法?

KAiTO 发表于 2024-3-21 09:32:53

报错很明显了
Plugin group_replication reported: 'This member has more executed transactions than those present in the group. Local transactions: f4343bed-e68a-11ee-9d06-000c293b6e72:1-4 > Group transactions: 2b5c6540-e5d0-11ee-8376-000c29ec4ae4:1-8, aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1-4'
此成员执行的事务比组中的事务多
在SECONDARY节点上使用 reset master 清空所有执行事务就好了

yejr 发表于 2024-3-21 12:48:50

KAiTO 发表于 2024-3-21 09:32
报错很明显了
Plugin group_replication reported: 'This member has more executed transactions than th ...

reset master还不够,因为第二个节点上可能有更多数据。

最好是用CLONE之类的方法重建第二个节点。

详情参考:有事务冲突时节点怎么加入MGR集群,https://mp.weixin.qq.com/s/F8NtR7igL6Nd4v2i1hvmNw
页: [1]
查看完整版本: 求助:部署单主MGR集群,第二个实例无法加入集群报错