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)
MGR Switch single-Primary to Muti_primary的更多相关文章
- MGR Switch Muti-Primary to single_primary
MGR Muti-Primary 切换 single_primary 模式 原因:因为希望做ProxySQL+MGR之间Proxy层的消耗测试,需要把原有的MGR多主改为单主模式. 修改MGRgrou ...
- MGR实现分析 - 成员管理与故障恢复实现
MySQL Group Replication(MGR)框架让MySQL具备了自动主从切换和故障恢复能力,举single primary(单主)模式为例,primary作为主节点对外提供读写服务,是唯 ...
- MySQL MGR实现分析 - 成员管理与故障恢复实现
此文已由作者温正湖授权网易云社区发布. 欢迎访问网易云社区,了解更多网易技术产品运营经验. MySQL Group Replication(MGR)框架让MySQL具备了自动主从切换和故障恢复能力,举 ...
- MySQL MGR 5.7.22 on centos 6.3 单主/多主搭建测试
搭建Mysql Group Replication本次搭建采用3个实例,三个服务器,同一个网段,MGR的参数配置在配置文件中添加.注意通讯端口号的配置,它用于组成员之间的通讯使用请确定当前MySQL版 ...
- Database Primary key and Foreign key [From Internet]
Database Primary key and Foreign key --Create Referenced Table CREATE TABLE Department ( DeptID int ...
- 找到当前mysql group replication 环境的primary结点
一.起原: mysql group replication 有两种模式.第一种是single primary 也就是说单个primary .这个模式下只有这一个主可以写入: 第二种是multi pri ...
- Unity 5 Game Optimization (Chris Dickinson 著)
1. Detecting Performance Issues 2. Scripting Strategies 3. The Benefits of Batching 4. Kickstart You ...
- Angular material mat-icon 资源参考_Images
ul,li>ol { margin-bottom: 0 } dt { font-weight: 700 } dd { margin: 0 1.5em 1.5em } img { height: ...
- Oracle PL/SQL 编程手册(SQL大全)
一.SQLPLUS 1引言 SQL命令 以下17个是作为语句开头的关键字: alterdroprevoke auditgrantrollback* commit*inse ...
随机推荐
- 分页---Vue+.net+bootstrap实现
通过学习Vue,的确觉的Vue的双向绑定使用起来十分方便,因此研究了一下列表显示时分页的实现,这里我使用了bootstrap的样式,所以在页面中引用bootstrap的样式文件,后台提数据源使用.ne ...
- BZOJ 1444 有趣的游戏(AC自动机+矩阵快速幂)
真的是很有趣的游戏... 对每个单词构建好AC自动机后,由于单词都是相同长度的且不同,所以不会出现互相为子串的形式. 那么我们对AC自动机上的节点构建转移矩阵.对于每个单词末尾的节点.该节点的出边仅仅 ...
- 【Mybatis】Mybatis的sql模糊查询
这个网站中有很多方法.https://code.google.com/p/mybatis/issues/detail?id=85 自己试验了如下的方法. 1. 参数中直接加入%% param.set ...
- Contest 6
A:容易发现这要求所有子集中元素的最高位1的位置相同,并且满足这个条件也是一定合法的.统计一下即可. #include<iostream> #include<cstdio> # ...
- Python常忘的进阶知识(下)
0.目录 1.装饰器 1.1 为每个函数都增加一个功能 1.2 装饰器只是一种模式 1.3 语法糖 1.4 函数需要传递参数,该如何更改装饰器? 1.5 函数需要传递关键字参数,该如何更改装饰器? 2 ...
- QVariant实质
QVariant实质 QVariant是一种可以存储不同类型的数据结构,在很多场合这是很有用得为了达到这种目的,可以想象,该对象应该存储对象的类型信息,数据信息以及其他辅助详细考虑用途,这种对象必须支 ...
- BZOJ3527:[ZJOI2014]力——题解
http://www.lydsy.com/JudgeOnline/problem.php?id=3527 给出n个数qi,给出Fj的定义如下: 令Ei=Fi/qi,求Ei. 参考:https://ww ...
- GDOI2015小Z的旅行路线
GDOI2015小Z的旅行路线 题意: \(n\)个点的无根树,边上有权值. \(q\)个询问\(s\)和\(s\),问从\(s\)出发,找一条最长路(不经过重复点),保证路径上所有边边权不超过\(x ...
- 7.Configurator API 详细介绍
一.Configurator类介绍与API解释 1.Configurator类介绍 1)用于设置脚本动过的默认延时 2)功能 a.可调节两个模拟动作间的默认时间间隔 b.可调节输入文本的输入时间间隔 ...
- python shell
os.system(cmd) 命令执行结果 0或者1 output = os.popen(cmd) print output.read() 通过 os.popen() 返回的是 file read 的 ...