1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
| # 如果节点发生故障, 在恢复后需要重新加入到MGR集群里, 正确的做法是: STOP GROUP_REPLICATION; START GROUP_REPLICATION;
# 如果某个节点挂了, 则其他的节点继续进行同步。当故障节点恢复后, 只需要手动激活下该节点的组复制功能, 即可正常加入到MGR组复制集群内并自动同步其他节点数据。 START GROUP_REPLICATION;
# 如果是i/o复制出现异常,确定数据无误后 # 查找主库的gtid情况 mysql> show global variables like '%gtid%'; +----------------------------------------------+------------------------------------------+ | Variable_name | Value | +----------------------------------------------+------------------------------------------+ | binlog_gtid_simple_recovery | ON | | enforce_gtid_consistency | ON | | group_replication_gtid_assignment_block_size | 1000000 | | gtid_executed | 24f16c50-3508-11ee-8fa3-fa163e353519:1-10| | gtid_executed_compression_period | 1000 | | gtid_mode | ON | | gtid_owned | | | gtid_purged | | | session_track_gtids | OFF | +----------------------------------------------+------------------------------------------+ gtid_executed的值:24f16c50-3508-11ee-8fa3-fa163e353519:1-10,be530001-350a-11ee-b128-fa163e353519:1-3803
# 在有故障的从库中操作 stop GROUP_REPLICATION; reset master; set global gtid_purged='24f16c50-3508-11ee-8fa3-fa163e353519:1-10,be530001-350a-11ee-b128-fa163e353519:1-3803';
# 启动组复制 START GROUP_REPLICATION;
# 添加白名单网段,一定要注意: 先关闭 Group Replication stop group_replication; set global group_replication_ip_whitelist="127.0.0.1/32,192.168.64.0/24"; start group_replication; show variables like "group_replication_ip_whitelist";
# 只读模式 Setting super_read_only=ON
|