MGR 验证测试

架构:

10.0.1.111
10.0.1.147
10.0.1.192

MySQL [test]> select * from performance_schema.replication_group_members;

+---------------------------+--------------------------------------+-------------+-------------+--------------+
| CHANNEL_NAME              | MEMBER_ID                            | MEMBER_HOST | MEMBER_PORT | MEMBER_STATE |
+---------------------------+--------------------------------------+-------------+-------------+--------------+
| group_replication_applier | 9208c7e9-2300-11eb-84ce-fa163e3bdc68 | master      |        3307 | ONLINE       |
| group_replication_applier | 922aea0f-2300-11eb-ade9-fa163e185828 | slave1      |        3307 | ONLINE       |
| group_replication_applier | 9234c4e6-2300-11eb-a184-fa163e313879 | slave2      |        3307 | ONLINE       |
+---------------------------+--------------------------------------+-------------+-------------+--------------+

二、多主切换到单主

1、住手组复制

mysql> show variables like '%group_replication_enforce_update_everywhere_checks%';
+----------------------------------------------------+-------+
| Variable_name | Value |
+----------------------------------------------------+-------+
| group_replication_enforce_update_everywhere_checks | ON |
+----------------------------------------------------+-------+
1 row in set (0.01 sec)

每个节点执行:

mysql> set global group_replication_enforce_update_everywhere_checks=off;
Query OK, 0 rows affected (0.00 sec)

mysql> show variables like '%group_replication_single_primary_mode%';
+---------------------------------------+-------+
| Variable_name | Value |
+---------------------------------------+-------+
| group_replication_single_primary_mode | OFF |
+---------------------------------------+-------+
1 row in set (0.01 sec)

,

以太坊数据网

www.326681.com采用以太坊区块链高度哈希值作为统计数据,联博以太坊统计数据开源、公平、无任何作弊可能性。联博统计免费提供API接口,支持多语言接入。

,

mysql> set global group_replication_single_primary_mode=on;
Query OK, 0 rows affected (0.00 sec)

2、择一个节点,打开 group_replication_bootstrap_group 为 on,并开启组复制,乐成后再关闭

set global group_replication_bootstrap_group=on;
start group_replication;
set global group_replication_bootstrap_group=off;

另外两个节点逐一开启组复制,加入集群环境,并通过视图查看集群情形

start group_replication;
select * from performance_schema.replication_group_members;

#查看 Primary 成员
select *from performance_schema.replication_group_members where member_id =(select variable_value from performance_schema.global_status WHERE VARIABLE_NAME= 'group_replication_primary_member');