zoukankan      html  css  js  c++  java
  • MGR Switch Muti-Primary to single_primary

    MGR Muti-Primary 切换 single_primary 模式

    原因:因为希望做ProxySQL+MGR之间Proxy层的消耗测试,需要把原有的MGR多主改为单主模式.

    • 修改MGRgroup_replication_single_primary_mode参数为ON
    root@localhost [(none)]>show global variables like '%group_replication_single_primary_mode%' ;
    +---------------------------------------+-------+
    | Variable_name                         | Value |
    +---------------------------------------+-------+
    | group_replication_single_primary_mode | OFF   |
    +---------------------------------------+-------+
    1 row in set (0.01 sec)
    
    root@localhost [(none)]>set global group_replication_single_primary_mode=ON;
    ERROR 3093 (HY000): Cannot change into or from single primary mode while Group Replication is running.
    
    • 提示不能在running下进行.只能把集群停下来:
      每个节点执行(注意记住最后的退出的节点):
    root@localhost [(none)]>stop group_replication;
    Query OK, 0 rows affected (9.26 sec)
    关闭节点后执行:
    set global group_replication_single_primary_mode=ON;
    ERROR 1231 (42000): Cannot turn ON single_primary_mode while enforce_update_everywhere_checks is enabled.
    执行:
    set global group_replication_enforce_update_everywhere_checks = OFF;
    set global group_replication_single_primary_mode=ON;
    Query OK, 0 rows affected (0.00 sec)
    再一次启动第一个MGR节点:
    set global group_replication_bootstrap_group=on; 
    start group_replication; 
    其它节点启动:
    set global group_replication_bootstrap_group=off;
    set global group_replication_enforce_update_everywhere_checks = OFF;
    set global group_replication_single_primary_mode=ON; 
    start group_replication; 
    
    一定要执行第2条,否则会报配置不兼容错误:
     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_replication_enforce_update_everywhere_checks], group configuration option: [group_replication_single_primary_mode]).'
    
  • 相关阅读:
    洛谷 P2616 [USACO10JAN]购买饲料II Buying Feed, II
    洛谷 P3654 First Step (ファーストステップ)
    洛谷 P1223 排队接水
    洛谷 【P1252】马拉松接力赛
    codevs 4927 线段树练习5
    洛谷 P1678 烦恼的高考志愿
    初识 线段树
    开学第一测
    洛谷 P1531 I Hate It
    CSS3 过渡
  • 原文地址:https://www.cnblogs.com/2woods/p/9524159.html
Copyright © 2011-2022 走看看