mysql mgr 重做_MySQL更高一般来说之MGR重新安装测试(讫)

本文介绍了在MySQL Group Replication (MGR) 中进行重做测试的过程,展示了如何查看主从状态及数据一致性。在单主模式下,首次启动复制组的成员成为主节点,只能执行DML操作。注意官方文档参数可能不适用于所有环境,可能导致不一致性和复杂的故障排查。
摘要由CSDN通过智能技术生成

###On the server zlm2.###

(root@localhost mysql3306.sock)[performance_schema]10:14:32>show variables like '%primary%';

+---------------------------------------+-------+

| Variable_name | Value |

+---------------------------------------+-------+

| group_replication_single_primary_mode | ON |

+---------------------------------------+-------+

1 row in set (0.01 sec)

(root@localhost mysql3306.sock)[(none)]10:14:40>select * from performance_schema.replication_group_members;

+---------------------------+--------------------------------------+-------------+-------------+--------------+

| CHANNEL_NAME | MEMBER_ID | MEMBER_HOST | MEMBER_PORT | MEMBER_STATE |

+---------------------------+--------------------------------------+-------------+-------------+--------------+

| group_replication_applier | 1b7181ee-6eaf-11e8-998e-080027de0e0e | zlm2 | 3306 | ONLINE |

| group_replication_applier | 5c77c31b-4add-11e8-81e2-080027de0e0e | zlm3 | 3306 | ONLINE |

| group_replication_applier | fc288b24-6934-11e8-9b0e-080027de0e0e | zlm4 | 3306 | ONLINE |

+---------------------------+--------------------------------------+-------------+-------------+--------------+

3 rows in set (0.00 sec)

(root@localhost mysql3306.sock)[(none)]10:15:15>show global status like 'group_replication_primary_member';

+----------------------------------+--------------------------------------+

| Variable_name | Value |

+----------------------------------+--------------------------------------+

| group_replication_primary_member | 1b7181ee-6eaf-11e8-998e-080027de0e0e |

+----------------------------------+--------------------------------------+

1 row in set (0.00 sec)

(root@localhost mysql3306.sock)[zlm]10:23:34>show tables;

+---------------+

| Tables_in_zlm |

+---------------+

| test_mgr |

+---------------+

1 row in set (0.00 sec)

(root@localhost mysql3306.sock)[zlm]10:23:57>select * from test_mgr;

+----+-----------+

| id | name |

+----+-----------+

| 1 | aaron8219 |

+----+-----------+

1 row in set (0.00 sec)

(root@localhost mysql3306.sock)[zlm]10:24:12>

###On the server zlm3.###

(root@localhost mysql3306.sock)[zlm]10:23:45>show tables;

+---------------+

| Tables_in_zlm |

+---------------+

| t1 |

| t2 |

| t3 |

| test_mgr |

+---------------+

4 rows in set (0.00 sec)

(root@localhost mysql3306.sock)[zlm]10:24:26>select * from test_mgr;

+----+-----------+

| id | name |

+----+-----------+

| 1 | aaron8219 |

+----+-----------+

1 row in set (0.01 sec)

(root@localhost mysql3306.sock)[zlm]10:24:28>insert into test_mgr(name) values('zlm');

ERROR 1290 (HY000): The MySQL server is running with the --super-read-only option so it cannot execute this statement

(root@localhost mysql3306.sock)[zlm]10:24:36>

###On the server zlm4.###

+---------------+

| Tables_in_zlm |

+---------------+

| t1 |

| t2 |

| t3 |

| test_mgr |

+---------------+

4 rows in set (0.01 sec)

(root@localhost mysql.sock)[zlm]10:28:14>select * from test_mgr;

+----+-----------+

| id | name |

+----+-----------+

| 1 | aaron8219 |

+----+-----------+

1 row in set (0.00 sec)

(root@localhost mysql.sock)[zlm]10:28:20>insert into test_mgr(name) values('zlm');

ERROR 1290 (HY000): The MySQL server is running with the --super-read-only option so it cannot execute this statement

(root@localhost mysql3306.sock)[zlm]10:28:58>

SummarySingle-primary mode is supported by default like what I've configured above.

The first member who creates replication group by starting it is the master who can merely do dml operations.

Parameter "group_replication_allow_local_disjoint_gtids_join" will lead to inconsistency and be deprecated in 5.7.21.

Becareful when using the parameters in examples of official documents which are probably imcompatible with your environment,that can cause complex troubleshooting procedure like what I did.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值