MySQL 5.7.17 Group Relication(组复制)搭建手册【转】
本博文介绍了Group Replication的两种工作模式的架构。
并详细介绍了Single-Master Mode的部署过程,以及如何切换到Multi-Master Mode。
当然,文末给出了Group Replication的配置要求和一些限制。
〇 结构介绍
在2016年12月发布的5.7.17版本的MySQL,甲骨文宣布Group Replication已经GA。
Group Replication(下简称GR)有两个工作模式,分别为Single-Master Mode与Multi-Master Mode:
Single-Master Mode的failover图:
只有primary成员可读写,而其他的节点为只读,在primary成员发生故障时,将会有其他成员顶替成primary。
Multi-Master Mode的failover图:
所有的成员均可读可写。
关于脑裂问题,可发现MySQL Group Replication与MongoDB Relicate Set有相似之处:
和MongoDB的Relicate Set相近,其读写库类似于Primary,只读库类似于Secondary。
(下图来自MySQL官方)
(下图来自MongoDB 3.4 Manual)
〇 部署
测试实例数量:3台
版本:MySQL 5.7.17
安装(此处用的是二进制包安装)
mysql-5.7.17-linux-glibc2.5-x86_64.tar.gz
创建数据目录及日志目录:
mkdir -p /data/mysql57/mysql3306
mkdir -p /data/mysql57/mysql3307
mkdir -p /data/mysql57/mysql3308
mkdir -p /data/mysql57/logs/
mkdir -p /data/mysql57/logs/
mkdir -p /data/mysql57/logs/
解压二进制包并将其设置为basedir:
mv mysql-5.7.-linux-glibc2.-x86_64.tar.gz /data/mysql57
cd /data/mysql57
tar zxvf mysql-5.7.-linux-glibc2.-x86_64.tar.gz
mv mysql-5.7.-linux-glibc2.-x86_64 mysql-basedir
〇 添加第一台实例:
添加3306实例的配置文件:
vim /data/mysql57/mysql3306/.cnf
[client]
prompt = "(\u@\h) [\d]> "
[mysqld]
server_id =
user = mysql
port =
socket = /tmp/mysql3306.sock
basedir = /data/mysql57/mysql-basedir
datadir = /data/mysql57/mysql3306
pid-file = /data/mysql57/mysql3306/.pid
log-error = /data/mysql57/logs//error-log
log-bin = /data/mysql57/logs//binlog
log-bin-index = /data/mysql57/logs//binlog.index
relay-log = /data/mysql57/logs//relaylog
relay-log-index = /data/mysql57/logs//relaylog.index
master_info_repository = TABLE
relay_log_info_repository = TABLE
log_slave_updates = ON
binlog_checksum = NONE
binlog_format = ROW
transaction_isolation = READ-COMMITTED
gtid_mode = ON
enforce_gtid_consistency = ON
# GR 配置项 其中loose前缀表示若Group Replication plugin未加载 mysql server仍继续启动
transaction_write_set_extraction = XXHASH64
loose-group_replication_group_name = "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa" # 组名,此处可拿select uuid();生成
loose-group_replication_start_on_boot = off # 在mysqld启动时不自动启动组复制
loose-group_replication_local_address = "127.0.0.1:24901"
loose-group_replication_group_seeds = "127.0.0.1:24901,127.0.0.1:24902,127.0.0.1:24903"
loose-group_replication_bootstrap_group = off
初始化3306实例datadir:
/data/mysql57/mysql-basedir/bin/mysqld --defaults-file=/data/mysql57/.cnf --initialize-insecure
启动3306实例:
/data/mysql57/mysql-basedir/bin/mysqld --defaults-file=/data/mysql57/.cnf &
通过MySQL Client进入第一个实例(密码为空)
/data/mysql57/mysql-basedir/bin/mysql -uroot -p -S /tmp/mysql3306.sock
创建复制用户与授权,并让其作为group的第一个成员:
SET SQL_LOG_BIN=;
CREATE USER repl@'%';
GRANT REPLICATION SLAVE ON *.* TO repl@'%' IDENTIFIED BY 'repl@123';
FLUSH PRIVILEGES;
SET SQL_LOG_BIN=;
CHANGE MASTER TO MASTER_USER='repl', MASTER_PASSWORD='repl@123' FOR CHANNEL 'group_replication_recovery';
安装GR插件:
(root@localhost) [(none)]> INSTALL PLUGIN group_replication SONAME 'group_replication.so';
Query OK, rows affected (0.07 sec)
可以检查一下是否安装成功:
(root@localhost) [(none)]> SELECT * FROM information_schema.plugins WHERE PLUGIN_NAME LIKE '%group%'\G
*************************** . row ***************************
PLUGIN_NAME: group_replication
PLUGIN_VERSION: 1.0
PLUGIN_STATUS: ACTIVE
PLUGIN_TYPE: GROUP REPLICATION
PLUGIN_TYPE_VERSION: 1.1
PLUGIN_LIBRARY: group_replication.so
PLUGIN_LIBRARY_VERSION: 1.7
PLUGIN_AUTHOR: ORACLE
PLUGIN_DESCRIPTION: Group Replication (1.0.)
PLUGIN_LICENSE: GPL
LOAD_OPTION: ON
row in set (0.00 sec)
开启第一个组复制:
(root@localhost) [(none)]> SET GLOBAL group_replication_bootstrap_group=ON;
Query OK, rows affected (0.00 sec)
(root@localhost) [(none)]> START GROUP_REPLICATION;
Query OK, rows affected (1.20 sec)
# 启动组复制之后将group_replication_bootstrap_group设置为OFF
# This option must only be set on one server and only when starting the group for the first time or restarting the entire group. After the group has been bootstrapped, set this option to OFF. It should be set to OFF both dynamically and in the configuration files
(root@localhost) [(none)]> SET GLOBAL group_replication_bootstrap_group=OFF;
Query OK, rows affected (0.01 sec)
检查一下组复制成员,其中member_id就是@@server_uuid的值
(root@localhost) [(none)]> SELECT * FROM performance_schema.replication_group_members;
+---------------------------+--------------------------------------+-------------+-------------+--------------+
| CHANNEL_NAME | MEMBER_ID | MEMBER_HOST | MEMBER_PORT | MEMBER_STATE |
+---------------------------+--------------------------------------+-------------+-------------+--------------+
| group_replication_applier | 3dc9cf4a-ec61-11e6-bdf3-000c297f23b7 | sAno1y | | ONLINE |
+---------------------------+--------------------------------------+-------------+-------------+--------------+
row in set (0.00 sec)
添加测试数据:
(root@localhost) [(none)]> CREATE DATABASE test;
Query OK, row affected (0.00 sec)
(root@localhost) [(none)]> USE test;
Database changed
(root@localhost) [test]> CREATE TABLE tb_test(id int PRIMARY KEY, name varchar()) CHARACTER SET utf8;
Query OK, rows affected (0.04 sec)
(root@localhost) [test]> INSERT INTO tb_test VALUES(,'风暴之灵');
Query OK, row affected (0.00 sec)
(root@localhost) [test]> INSERT INTO tb_test VALUES(,'影之灵龛');
Query OK, row affected (0.01 sec)
(root@localhost) [test]> UPDATE tb_test SET name='斯嘉蒂之眼' WHERE id=;
Query OK, row affected (0.02 sec)
Rows matched: Changed: Warnings:
(root@localhost) [test]> SELECT * FROM tb_test;
+----+-----------------+
| id | name |
+----+-----------------+
| | 风暴之灵 |
| | 斯嘉蒂之眼 |
+----+-----------------+
rows in set (0.00 sec)
〇 添加第二个实例(3307)
修改3307配置文件,将3306改成3307,并且将loose-group_replication_local_address的端口从24901改成24902:
cp /data/mysql57/.cnf /data/mysql57/.cnf
sed -i "s/3306/3307/g" /data/mysql57/.cnf
sed -i "s/24901\"/24902\"/g" .cnf
初始化3307实例:
/data/mysql57/mysql-basedir/bin/mysqld --defaults-file=/data/mysql57/.cnf --initialize-insecure
启动3307实例:
/data/mysql57/mysql-basedir/bin/mysqld --defaults-file=/data/mysql57/.cnf &
通过MySQL Client进入3307实例:
/data/mysql57/mysql-basedir/bin/mysql -uroot -p -S /tmp/mysql3307.sock
重复在3306实例的操作:
SET SQL_LOG_BIN=;
CREATE USER repl@'%';
GRANT REPLICATION SLAVE ON *.* TO repl@'%' IDENTIFIED BY 'repl@123';
FLUSH PRIVILEGES;
SET SQL_LOG_BIN=;
CHANGE MASTER TO MASTER_USER='repl', MASTER_PASSWORD='repl@123' FOR CHANNEL 'group_replication_recovery';
在3307实例上安装GR插件,开启组复制:
(root@localhost) [(none)]> INSTALL PLUGIN group_replication SONAME 'group_replication.so';
Query OK, rows affected (0.00 sec)
(root@localhost) [(none)]> START GROUP_REPLICATION;
Query OK, rows affected (5.61 sec)
检查一下成员状态:
(root@localhost) [(none)]> SELECT * FROM performance_schema.replication_group_members;
+---------------------------+--------------------------------------+-------------+-------------+--------------+
| CHANNEL_NAME | MEMBER_ID | MEMBER_HOST | MEMBER_PORT | MEMBER_STATE |
+---------------------------+--------------------------------------+-------------+-------------+--------------+
| group_replication_applier | 3dc9cf4a-ec61-11e6-bdf3-000c297f23b7 | sAno1y | | ONLINE |
| group_replication_applier | 6bddae0d-eca1-11e6-b9d5-000c297f23b7 | sAno1y | | RECOVERING |
+---------------------------+--------------------------------------+-------------+-------------+--------------+
rows in set (0.00 sec)
过了一阵子再检查,仍然是RECOVERING。
再过一阵子检查,发现member_state被置为ERROR:
(root@localhost) [(none)]> SELECT * FROM performance_schema.replication_group_members;
+---------------------------+--------------------------------------+-------------+-------------+--------------+
| CHANNEL_NAME | MEMBER_ID | MEMBER_HOST | MEMBER_PORT | MEMBER_STATE |
+---------------------------+--------------------------------------+-------------+-------------+--------------+
| group_replication_applier | 6bddae0d-eca1-11e6-b9d5-000c297f23b7 | sAno1y | | ERROR |
+---------------------------+--------------------------------------+-------------+-------------+--------------+
row in set (0.01 sec)
此时检查3306实例的组复制情况,发现检查不到另一个实例的信息了:
(root@localhost) [(none)]> SELECT * FROM performance_schema.replication_group_members;
+---------------------------+--------------------------------------+-------------+-------------+--------------+
| CHANNEL_NAME | MEMBER_ID | MEMBER_HOST | MEMBER_PORT | MEMBER_STATE |
+---------------------------+--------------------------------------+-------------+-------------+--------------+
| group_replication_applier | 3dc9cf4a-ec61-11e6-bdf3-000c297f23b7 | sAno1y | | ONLINE |
+---------------------------+--------------------------------------+-------------+-------------+--------------+
row in set (0.00 sec)
开多一个终端,检查3307实例的error log发现:
--07T12::.674093Z [ERROR] Slave I/O for channel 'group_replication_recovery': error connecting to master 'repl@sAno1y:3306' - retry-time: retries: , Error_code:
应该是解析的问题,修改hosts文件,在末尾加上主机名:
[root@sAno1y ]# hostname
sAno1y
[root@sAno1y ]# cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 sAno1y
:: localhost localhost.localdomain localhost6 localhost6.localdomain6 sAno1y
重新操作3307实例:
(root@localhost) [(none)]> STOP GROUP_REPLICATION;
Query OK, rows affected (0.00 sec)
(root@localhost) [(none)]> START GROUP_REPLICATION;
Query OK, rows affected (7.80 sec)
检查组复制状态,发现两个实例的状态均为ONLINE了:
(root@localhost) [(none)]> SELECT * FROM performance_schema.replication_group_members;
+---------------------------+--------------------------------------+-------------+-------------+--------------+
| CHANNEL_NAME | MEMBER_ID | MEMBER_HOST | MEMBER_PORT | MEMBER_STATE |
+---------------------------+--------------------------------------+-------------+-------------+--------------+
| group_replication_applier | 3dc9cf4a-ec61-11e6-bdf3-000c297f23b7 | sAno1y | | ONLINE |
| group_replication_applier | 6bddae0d-eca1-11e6-b9d5-000c297f23b7 | sAno1y | | ONLINE |
+---------------------------+--------------------------------------+-------------+-------------+--------------+
rows in set (0.00 sec)
在3307上检查一下同步状态:
(root@localhost) [(none)]> SELECT * FROM test.tb_test;
+----+-----------------+
| id | name |
+----+-----------------+
| | 风暴之灵 |
| | 斯嘉蒂之眼 |
+----+-----------------+
rows in set (0.00 sec)
〇 添加3308实例:
修改3308配置文件:
cp /data/mysql57/.cnf /data/mysql57/.cnf
sed -i "s/3306/3308/g" .cnf
sed -i "s/24901\"/24093\"/g" .cnf
然后初始化并启动3308实例:
/data/mysql57/mysql-basedir/bin/mysqld --defaults-file=/data/mysql57/.cnf --initialize-insecure
/data/mysql57/mysql-basedir/bin/mysqld --defaults-file=/data/mysql57/.cnf &
同样进入3308实例:
/data/mysql57/mysql-basedir/bin/mysql -uroot -p -S /tmp/mysql3308.sock
在3308实例上重复操作:
SET SQL_LOG_BIN=;
CREATE USER repl@'%';
GRANT REPLICATION SLAVE ON *.* TO repl@'%' IDENTIFIED BY 'repl@123';
FLUSH PRIVILEGES;
SET SQL_LOG_BIN=;
CHANGE MASTER TO MASTER_USER='repl', MASTER_PASSWORD='repl@123' FOR CHANNEL 'group_replication_recovery';
继续重复操作,安装GR插件并启动它:
INSTALL PLUGIN group_replication SONAME 'group_replication.so';
START GROUP_REPLICATION;
最后再检查一下组复制成员的状态:
(root@localhost) [(none)]> SELECT * FROM performance_schema.replication_group_members;
+---------------------------+--------------------------------------+-------------+-------------+--------------+
| CHANNEL_NAME | MEMBER_ID | MEMBER_HOST | MEMBER_PORT | MEMBER_STATE |
+---------------------------+--------------------------------------+-------------+-------------+--------------+
| group_replication_applier | 3dc9cf4a-ec61-11e6-bdf3-000c297f23b7 | sAno1y | | ONLINE |
| group_replication_applier | 6bddae0d-eca1-11e6-b9d5-000c297f23b7 | sAno1y | | ONLINE |
| group_replication_applier | 6ce8c980-ed4a-11e6-bf00-000c297f23b7 | sAno1y | | ONLINE |
+---------------------------+--------------------------------------+-------------+-------------+--------------+
rows in set (0.00 sec)
当然在3308实例上也已将3306的事务apply过来了:
(root@localhost) [(none)]> SELECT * FROM test.tb_test;
+----+-----------------+
| id | name |
+----+-----------------+
| | 风暴之灵 |
| | 斯嘉蒂之眼 |
+----+-----------------+
rows in set (0.00 sec)
root@localhost用户在上述操作中为空密码,可以给root@localhost加个密码……
因为三个实例都在一个GR组里,所以对3306实例操作就行了:
/data/mysql57/mysql-basedir/bin/mysql -uroot -p -S /tmp/mysql3306.sock -e "ALTER USER root@localhost IDENTIFIED BY 'root123';"
当然ALTER操作会被记录到3306的binlog里,并同步到3307和3308实例上。
可以查看一下三台实例的read_only和super-read-only值:
[root@sAno1y mysql57]# /data/mysql57/mysql-basedir/bin/mysql -uroot -proot123 -S /tmp/mysql3306.sock -e "SELECT @@read_only, @@super_read_only";
mysql: [Warning] Using a password on the command line interface can be insecure.
+-------------+-------------------+
| @@read_only | @@super_read_only |
+-------------+-------------------+
| | |
+-------------+-------------------+
[root@sAno1y mysql57]# /data/mysql57/mysql-basedir/bin/mysql -uroot -proot123 -S /tmp/mysql3307.sock -e "SELECT @@read_only, @@super_read_only";
mysql: [Warning] Using a password on the command line interface can be insecure.
+-------------+-------------------+
| @@read_only | @@super_read_only |
+-------------+-------------------+
| | |
+-------------+-------------------+
[root@sAno1y mysql57]# /data/mysql57/mysql-basedir/bin/mysql -uroot -proot123 -S /tmp/mysql3308.sock -e "SELECT @@read_only, @@super_read_only";
mysql: [Warning] Using a password on the command line interface can be insecure.
+-------------+-------------------+
| @@read_only | @@super_read_only |
+-------------+-------------------+
| | |
+-------------+-------------------+
可以发现只有3306实例也就是第一个实例属于可写实例,而3307和3308均为read-only模式。
决定因素为第一个加入该GR组的成员,之后加入该GR组的均为ro,在该模式与MongoDB Replicate Set很相似。
当然如果要确定哪一个成员是primary,可以在三个成员中的任意一个执行:
SELECT b.member_id, b.member_host, b.member_port
FROM performance_schema.global_status a
JOIN performance_schema.replication_group_members b
ON a.variable_value = b.member_id
WHERE a.variable_name= 'group_replication_primary_member';
# 输出结果:
+--------------------------------------+-------------+-------------+
| member_id | member_host | member_port |
+--------------------------------------+-------------+-------------+
| 3dc9cf4a-ec61-11e6-bdf3-000c297f23b7 | sAno1y | |
+--------------------------------------+-------------+-------------+
row in set (0.00 sec)
至此,Group Replication默认的single-master mode已经搭建完毕。
〇 将Single-Master Mode修改为Multi-Master Mode
如果要将Single-Master Mode修改为Multi-Master Mode,也比较简单。
考虑到此时的Primary成员是3306,并且假定3306实例在对外提供写服务,我这边的操作如下:
首先停掉两个secondary的组复制,在3307和3308实例上操作:
STOP GROUP_REPLICATION;
SET GLOBAL group_replication_single_primary_mode=FALSE;
SET GLOBAL group_replication_enforce_update_everywhere_checks=TRUE;
再在3306实例上重复以上操作:
STOP GROUP_REPLICATION;
SET GLOBAL group_replication_single_primary_mode=FALSE;
SET GLOBAL group_replication_enforce_update_everywhere_checks=TRUE;
然后在3306上作为第一个成员启动组复制:
(root@localhost) [(none)]> SET GLOBAL group_replication_bootstrap_group=on;
Query OK, rows affected (0.00 sec)
(root@localhost) [(none)]> START GROUP_REPLICATION;
Query OK, rows affected (1.05 sec)
(root@localhost) [(none)]> SET GLOBAL group_replication_bootstrap_group=off;
Query OK, rows affected (0.00 sec)
在停启组复制的过程中,3306实例仍对外提供服务,此处模拟修改:
(root@localhost) [(none)]> UPDATE test.tb_test SET name='灵魂守卫' WHERE id=;
Query OK, row affected (0.02 sec)
Rows matched: Changed: Warnings:
(root@localhost) [(none)]> INSERT INTO test.tb_test VALUES(,'幻影斧');
Query OK, row affected (0.00 sec)
(root@localhost) [(none)]> SELECT * FROM test.tb_test;
+----+-----------------+
| id | name |
+----+-----------------+
| | 灵魂守卫 |
| | 斯嘉蒂之眼 |
| | 幻影斧 |
+----+-----------------+
rows in set (0.00 sec)
再3307和3308两个实例上分别开启组复制:
START GROUP_REPLICATION;
并检查3307和3308是否将3306的事务应用过来:
[root@sAno1y mysql57]# /data/mysql57/mysql-basedir/bin/mysql -uroot -proot123 -S /tmp/mysql3307.sock -e "START GROUP_REPLICATION;"
mysql: [Warning] Using a password on the command line interface can be insecure.
[root@sAno1y mysql57]#
[root@sAno1y mysql57]# /data/mysql57/mysql-basedir/bin/mysql -uroot -proot123 -S /tmp/mysql3308.sock -e "START GROUP_REPLICATION;"
mysql: [Warning] Using a password on the command line interface can be insecure.
[root@sAno1y mysql57]# /data/mysql57/mysql-basedir/bin/mysql -uroot -proot123 -S /tmp/mysql3307.sock -e "SELECT * FROM test.tb_test;"
mysql: [Warning] Using a password on the command line interface can be insecure.
+----+-----------------+
| id | name |
+----+-----------------+
| | 灵魂守卫 |
| | 斯嘉蒂之眼 |
| | 幻影斧 |
+----+-----------------+
[root@sAno1y mysql57]# /data/mysql57/mysql-basedir/bin/mysql -uroot -proot123 -S /tmp/mysql3308.sock -e "SELECT * FROM test.tb_test;"
mysql: [Warning] Using a password on the command line interface can be insecure.
+----+-----------------+
| id | name |
+----+-----------------+
| | 灵魂守卫 |
| | 斯嘉蒂之眼 |
| | 幻影斧 |
+----+-----------------+
当然可以看到,在3306上做的修改,在3307和3308开启组复制之后也已经同步过来了。
那么再检查一下3307和3308是否可写:
[root@sAno1y mysql57]# /data/mysql57/mysql-basedir/bin/mysql -uroot -proot123 -S /tmp/mysql3307.sock -e "SELECT @@read_only, @@super_read_only;"
mysql: [Warning] Using a password on the command line interface can be insecure.
+-------------+-------------------+
| @@read_only | @@super_read_only |
+-------------+-------------------+
| | |
+-------------+-------------------+
[root@sAno1y mysql57]# /data/mysql57/mysql-basedir/bin/mysql -uroot -proot123 -S /tmp/mysql3308.sock -e "SELECT @@read_only, @@super_read_only;"
mysql: [Warning] Using a password on the command line interface can be insecure.
+-------------+-------------------+
| @@read_only | @@super_read_only |
+-------------+-------------------+
| | |
+-------------+-------------------+
显然和Single-Master Mode不一样的是,除了3306实例,另外两个成员也就是3307和3308实例均为可写成员了。
也就是所谓的Multi-Master Mode。
当然可以测试一下:
在3307实例上做insert,在3308实例上update,最后在3306上查询:
[root@sAno1y mysql57]# /data/mysql57/mysql-basedir/bin/mysql -uroot -proot123 -S /tmp/mysql3307.sock -e "INSERT INTO test.tb_test VALUES(4,'吸血面具')";
mysql: [Warning] Using a password on the command line interface can be insecure.
[root@sAno1y mysql57]# /data/mysql57/mysql-basedir/bin/mysql -uroot -proot123 -S /tmp/mysql3308.sock -e "UPDATE test.tb_test SET name='撒旦之邪力' WHERE id=4;"
mysql: [Warning] Using a password on the command line interface can be insecure.
[root@sAno1y mysql57]# /data/mysql57/mysql-basedir/bin/mysql -uroot -proot123 -S /tmp/mysql3306.sock -e "SELECT * FROM test.tb_test;"
mysql: [Warning] Using a password on the command line interface can be insecure.
+----+-----------------+
| id | name |
+----+-----------------+
| | 灵魂守卫 |
| | 斯嘉蒂之眼 |
| | 幻影斧 |
| | 撒旦之邪力 |
+----+-----------------+
至此,已经成功将Single-Master Mode修改为Multi-Master Mode。
P.S. 在多主模式中,已经不能通过下述SQL来查询primary member是哪一台实例了……虽然不明白为毛,可能在后续版本会改进???(猜测)
但总之在多主模式中,每一台status为online的成员都是primary。
SELECT b.member_id, b.member_host, b.member_port
FROM performance_schema.global_status a
JOIN performance_schema.replication_group_members b
ON a.variable_value = b.member_id
WHERE a.variable_name= 'group_replication_primary_member';
总之……看起来很好用的样子。
从零开始搭建Multi-Master Mode的GR同样也很简单,可以参考:
http://mysqlhighavailability.com/mysqlha/gr/doc/getting_started.html
两种工作模式在配置参数上的核心差别为:
loose-group_replication_single_primary_mode=FALSE
loose-group_replication_enforce_update_everywhere_checks=TRUE
(single-master mode 这俩个参数的值为TRUE和FALSE)
〇 要求和限制
仅可用于InnoDB存储引擎(需要事务的支持和行级锁)
表必须有主键(创建无主键的表不会报错,但在插入数据的时候会抛出:ERROR 3098 (HY000): The table does not comply with the requirements by an external plugin.)
必须启用GTID
必须开启二进制日志,并且其格式必须为ROW(binlog_format=row)
冲突DDl、DML只能在同一成员上执行成功
在多主结构中,不完全支持外键(单主结构中是没有问题的)
不支持serializable的事务隔离级别
只支持IPv4,并且需要低延迟,高带宽的网络环境
GR最大支持9个成员
复制信息元数据必须存在系统表(master-info-repository=TABLE、relay-log-info-repository=TABLE)
二进制日志checksums必须关闭(binlog-checksum=NONE)
不支持savepoint的使用
〇 参考文档:
MySQL 5.7 Reference Manual - 19.2 Group Replication
马楚成 - 使用群组复制实现MySQL高可用性 (https://www.mysql.com/news-and-events/web-seminars/mysql-cluster-ha-group-replication2-zh/)
mysqlha组文档 Docs ? Requirements and Limitations
转自
MySQL 5.7.17 Group Relication(组复制)搭建手册-神谕丶-ITPUB博客
http://blog.itpubhttp.itpub.net/29773961/viewspace-2133314/
MySQL 5.7.17 Group Relication(组复制)搭建手册【转】的更多相关文章
- MySQL组复制MGR(二)-- 组复制搭建
(一)主机操作 (1)路由信息vmnet5 192.168.10.0 (2)主机信息 主机名称 IP地址 操作系统版本 数据库版本 mgr-node1 192.168.10.11 centos 7.4 ...
- [MySQL Reference Manual]17 Group Replication
17 Group Replication 17 Group Replication 17.1 Group Replication后台 17.1.1 Replication技术 17.1.1.1 主从复 ...
- mysql 不同版本下 group by 组内排序的差异
最近发现网上找的 group by 组内排序语句在不同的mysql版本中结果不一样. 建表语句: SET FOREIGN_KEY_CHECKS=0; -- ---------------- ...
- MySQL 5.7.17 Group Replication 初始
http://blog.csdn.net/mchdba/article/details/53957248
- Mysql Group Replication 简介及单主模式组复制配置【转】
一 Mysql Group Replication简介 Mysql Group Replication(MGR)是一个全新的高可用和高扩张的MySQL集群服务. 高一致性,基于原生复制及p ...
- MySQL高可用之组复制(4):详细分析组复制理论
MySQL组复制系列文章: MySQL组复制大纲 MySQL组复制(1):组复制技术简介 MySQL组复制(2):配置单主模型的组复制 MySQL组复制(3):配置多主模型的组复制 MySQL组复制( ...
- MySQL组复制MGR(一)-- 技术概述
(一)复制技术的发展 MySQL的复制技术主要经历了异步主从复制,半同步复制,组复制(Group Replication)3个阶段. (1)传统的异步主从复制 传统的MySQL提供了一种简单的主从复制 ...
- MySQL高可用之组复制技术(3):配置多主模型的组复制
MySQL组复制系列文章: MySQL组复制大纲 MySQL组复制(1):组复制技术简介 MySQL组复制(2):配置单主模型的组复制 MySQL组复制(3):配置多主模型的组复制 MySQL组复制( ...
- mysql组复制集群简介
mysql组复制集群拓扑: 环境: centos6.5 mysql5.7.19 一.组复制搭建: 配置hosts文件 再三台服务器上分别启动一个mysql实例,共三个. 参考配置文件如下: serve ...
随机推荐
- (待修莫队 没过! 抽空在检查)Dynamic len(set(a[L:R])) UVA - 12345
#include <iostream> #include <cstdio> #include <sstream> #include <cstring> ...
- Day24--Part2-伪Ajax(iframe)
参考:http://www.pythonsite.com/ 赵凡同学的博客,每一份努力都值得期许! 867468837 Ajax操作---伪Ajax (iframe) 一,基于iframe实现伪Aja ...
- 消除unchecked cast Warning
在Java中,经常会将一个Object类型转成自己想要的Map.List等等.通常的做法是: Object obj = ....; Map<String, String> castMap ...
- java多线程 -- Condition 控制线程通信
Api文档如此定义: Condition 将 Object 监视器方法(wait.notify 和 notifyAll)分解成截然不同的对象,以便通过将这些对象与任意 Lock 实现组合使用,为每个对 ...
- Java EE之Servlet
1.创建Servlet类 Servlet在Java EE API规范中的定义: Servlet是一个运行在Web服务器中的Java小程序.Servlet将会接收和响应来自Web客户端的请求,使用HTT ...
- bzoj 3853 : GCD Array
搬运题解Claris:1 n d v相当于给$a[x]+=v[\gcd(x,n)=d]$ $\begin{eqnarray*}&&v[\gcd(x,n)=d]\\&=& ...
- BZOJ 2140 稳定婚姻
2140: 稳定婚姻 Description 我国的离婚率连续7年上升,今年的头两季,平均每天有近5000对夫妇离婚,大城市的离婚率上升最快,有研究婚姻问题的专家认为,是与简化离婚手续有关. 25岁的 ...
- EOJ 262 润清的烦恼
——题目出处zhoutb2333 题解: 3e6可以带一个log 又是下取整问题.但是分块会TLE. 这样考虑,我们把式子拆成两个部分. 我们先算出来每一个x的[ai/x]项,再算出来[x/ai]项. ...
- windows下64位python的安装及机器学习相关包的安装(实用)
开通博客已久,想了好久决定写个基础的安装教程,望后人少走弯路,也借此希望跟大家多多交流.文中给出的链接默认是基于对python2.7的前提下的包. 1.首先下载64位Python包,进行安装(默认py ...
- 51NOD 1105 第K大的数
数组A和数组B,里面都有n个整数. 数组C共有n^2个整数,分别是: A[0] * B[0],A[0] * B[1] ...... A[0] * B[n-1] A[1] * B[0],A[1] * B ...