博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
MGR Switch single-Primary to Muti_primary
阅读量:5819 次
发布时间:2019-06-18

本文共 3828 字,大约阅读时间需要 12 分钟。

MGR single_primary 切换 Muti-Primary 模式

root@localhost [(none)]>select *  from performance_schema.replication_group_members;+---------------------------+--------------------------------------+-------------+-------------+--------------+| CHANNEL_NAME              | MEMBER_ID                            | MEMBER_HOST | MEMBER_PORT | MEMBER_STATE |+---------------------------+--------------------------------------+-------------+-------------+--------------+| group_replication_applier | 33a6c4f8-a67a-11e8-b7f6-0050568beaf6 | db211       |        3507 | ONLINE       || group_replication_applier | 951678d2-91a2-11e8-be71-0050568be82c | db210       |        3507 | ONLINE       || group_replication_applier | abac4f08-a683-11e8-9447-0050568b744a | db212       |        3507 | ONLINE       |+---------------------------+--------------------------------------+-------------+-------------+--------------+3 rows in set (0.00 sec)root@localhost [(none)]>set global group_replication_single_primary_mode=1;ERROR 3093 (HY000): Cannot change into or from single primary mode while Group Replication is running.root@localhost [(none)]>stop group_replication;Query OK, 0 rows affected (9.28 sec)root@localhost [(none)]>set global group_replication_single_primary_mode=0;Query OK, 0 rows affected (0.00 sec)root@localhost [(none)]>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.root@localhost [(none)]>
  • 查看error.log日志:
    也就是说,需要所有节点都关闭后修改一致再启动.
2018-08-23T16:58:19.616446+08:00 0 [ERROR] Plugin group_replication reported: 'The member configuration is not compatible with the group configuration. Variables such as single_primary_mode or enforce_update_everywhere_checks must have the same value on every server in the group. (member configuration option: [], group configuration option: [group_replication_single_primary_mode]).'
  • 所有节点stop group_replication并设置root@localhost [(none)]>set global group_replication_single_primary_mode=0;再逐一启动:
root@localhost [(none)]>set global group_replication_single_primary_mode=0;Query OK, 0 rows affected (0.00 sec)root@localhost [(none)]>set global group_replication_bootstrap_group=1;Query OK, 0 rows affected (0.00 sec)root@localhost [(none)]>start group_replication;Query OK, 0 rows affected (2.01 sec)root@localhost [(none)]>最后一个节点:root@localhost [(none)]>set global group_replication_single_primary_mode=0;Query OK, 0 rows affected (0.01 sec)root@localhost [(none)]>start group_replication;Query OK, 0 rows affected (3.14 sec)root@localhost [(none)]>select *  from performance_schema.replication_group_members;+---------------------------+--------------------------------------+-------------+-------------+--------------+| CHANNEL_NAME              | MEMBER_ID                            | MEMBER_HOST | MEMBER_PORT | MEMBER_STATE |+---------------------------+--------------------------------------+-------------+-------------+--------------+| group_replication_applier | 33a6c4f8-a67a-11e8-b7f6-0050568beaf6 | db211       |        3507 | ONLINE       || group_replication_applier | 951678d2-91a2-11e8-be71-0050568be82c | db210       |        3507 | ONLINE       || group_replication_applier | abac4f08-a683-11e8-9447-0050568b744a | db212       |        3507 | ONLINE       |+---------------------------+--------------------------------------+-------------+-------------+--------------+3 rows in set (0.00 sec)root@localhost [(none)]>show global variables like '%single%';+---------------------------------------+-------+| Variable_name                         | Value |+---------------------------------------+-------+| group_replication_single_primary_mode | OFF   |+---------------------------------------+-------+1 row in set (0.00 sec)

转载于:https://www.cnblogs.com/2woods/p/9524550.html

你可能感兴趣的文章
leetcode之Spiral Matrix
查看>>
【国家集训队】middle
查看>>
webpack window 添加ES6支出
查看>>
比较css中单位px,em和rem的区别
查看>>
2014/03/04
查看>>
用定时器实现逐渐放大层的功能
查看>>
正则表达式 非获取匹配
查看>>
jdk版本及编译版本导致服务器部署UnsupportedClassVersionError错误
查看>>
Android升级ADT22后会报ClassNotFoundException的原因分析
查看>>
live555的编译及使用
查看>>
Longest Palindromic Substring
查看>>
springmvc注解事例
查看>>
如何实现自定义的DataSource
查看>>
SAP ECC MM 配置文档
查看>>
spring整合kafka项目生产和消费测试结果记录(一)
查看>>
利用fputcsv导出数据备份数据
查看>>
Hadoop学习
查看>>
吴哥窟游记(一)
查看>>
【翻译】Sencha Touch 2入门:创建一个实用的天气应用程序之三
查看>>
解决vc中unable to connect to the MKS:Internal error问题
查看>>