zoukankan      html  css  js  c++  java
  • MGR Switch single-Primary to Muti_primary

    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)
    
    
  • 相关阅读:
    Python分析44130条用户观影数据,挖掘用户与电影之间的隐藏信息!
    办公利器!用Python快速将任意文件转为PDF
    教你用python搭建一个「生活常识解答」机器人
    办公利器!用Python批量识别发票并录入到Excel表格
    遇到禁止复制该怎么办?幸好我会Python...
    通知:生物信息学云论坛第十五场报告会
    centos7设置SSH安全策略–指定IP登陆
    SpringMVC—RequestMapping注解参数说明
    SpringMVC-方法四种类型返回值总结,你用过几种?
    Window下:自带python编辑器的wxpython项目发布打包exe
  • 原文地址:https://www.cnblogs.com/2woods/p/9524550.html
Copyright © 2011-2022 走看看