[root@iz2zec57gfl6i9vbtdksl1z ~]# docker run --detach --memory=500m --memory-swap=1g --hostname=mysql-mgr-server3 --net=b1 --ip=172.19.0.4 --add-host mysql-mgr-server1:172.19.0.2 --add-host mysql-mgr-server2:172.19.0.3 --publish 3309:3306 --volume=/mnt/mysql_data/conf.d/s3-docker/:/etc/mysql/conf.d --volume=/mnt/mysql_data/s3-docker:/var/lib/mysql --name=s3-docker -e MYSQL_ROOT_PASSWORD=123456 -d docker.io/mysql:5.7.17
[root@iz2zec57gfl6i9vbtdksl1z ~]# docker run --detach --memory=500m --memory-swap=1g --hostname=mysql-mgr-server2 --net=b1 --ip=172.19.0.3 --add-host mysql-mgr-server1:172.19.0.2 --add-host mysql-mgr-server3:172.19.0.4 --publish 3308:3306 --volume=/mnt/mysql_data/conf.d/s2-docker/:/etc/mysql/conf.d --volume=/mnt/mysql_data/s2-docker:/var/lib/mysql --name=s2-docker -e MYSQL_ROOT_PASSWORD=123456 -d docker.io/mysql:5.7.17
[root@iz2zec57gfl6i9vbtdksl1z ~]# docker run --detach --memory=500m --memory-swap=1g --hostname=mysql-mgr-server1 --net=b1 --ip=172.19.0.2 --add-host mysql-mgr-server1:172.19.0.3 --add-host mysql-mgr-server3:172.19.0.4 --publish 3307:3306 --volume=/mnt/mysql_data/conf.d/s1-docker/:/etc/mysql/conf.d --volume=/mnt/mysql_data/s1-docker:/var/lib/mysql --name=s1-docker -e MYSQL_ROOT_PASSWORD=123456 -d docker.io/mysql:5.7.17
[root@iz2zec57gfl6i9vbtdksl1z ~]# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
30396bcd7ffb docker.io/mysql:5.7.17 "docker-entrypoint.sh" 7 hours ago Up 7 hours 0.0.0.0:3309->3306/tcp s3-docker
6644ab2fa9ae docker.io/mysql:5.7.17 "docker-entrypoint.sh" 7 hours ago Up 7 hours 0.0.0.0:3308->3306/tcp s2-docker
7ca53c437c5a docker.io/mysql:5.7.17 "docker-entrypoint.sh" 8 hours ago Up 8 hours 0.0.0.0:3307->3306/tcp s1-docker
[root@iz2zec57gfl6i9vbtdksl1z conf.d]# docker logs <CONTAINER ID>
[root@iz2zec57gfl6i9vbtdksl1z ~]# docker exec -it s1-docker bash
root@mysql-mgr-server1:/# mysql -uroot -p123456
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 116
Server version: 5.7.17-log MySQL Community Server (GPL)
Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> SET SQL_LOG_BIN=0;
Query OK, 0 rows affected (0.00 sec)
mysql> CREATE USER rpl_user@'%';
Query OK, 0 rows affected (0.00 sec)
mysql> GRANT REPLICATION SLAVE ON *.* TO rpl_user@'%' IDENTIFIED BY 'rpl_pass';
Query OK, 0 rows affected, 1 warning (0.00 sec)
Query OK, 0 rows affected (0.00 sec)
mysql> SET SQL_LOG_BIN=1;
Query OK, 0 rows affected (0.00 sec)
mysql> CHANGE MASTER TO MASTER_USER='rpl_user', MASTER_PASSWORD='rpl_pass' FOR CHANNEL 'group_replication_recovery';
Query OK, 0 rows affected, 2 warnings (0.03 sec)
mysql> INSTALL PLUGIN group_replication SONAME 'group_replication.so';
Query OK, 0 rows affected (0.01 sec)
mysql> SET GLOBAL group_replication_bootstrap_group=ON;
Query OK, 0 rows affected (0.01 sec)
mysql> START GROUP_REPLICATION;
Query OK, 0 rows affected (0.01 sec)
mysql> SET GLOBAL group_replication_bootstrap_group=OFF;
Query OK, 0 rows affected (0.01 sec)
mysql> SELECT * FROM performance_schema.replication_group_members;
+---------------------------+--------------------------------------+-------------------+-------------+--------------+
| CHANNEL_NAME | MEMBER_ID | MEMBER_HOST | MEMBER_PORT | MEMBER_STATE |
+---------------------------+--------------------------------------+-------------------+-------------+--------------+
| group_replication_applier | d79c04bf-87a3-11e7-865f-0242ac130002 | mysql-mgr-server1 | 3306 | ONLINE
+---------------------------+--------------------------------------+-------------------+-------------+--------------+
[root@iz2zec57gfl6i9vbtdksl1z ~]# docker exec -it s2-docker bash
root@mysql-mgr-server2:/# mysql -uroot -p123456
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.7.17-log MySQL Community Server (GPL)
Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> SET SQL_LOG_BIN=0;
Query OK, 0 rows affected (0.00 sec)
mysql> CREATE USER rpl_user@'%';
Query OK, 0 rows affected (0.00 sec)
mysql> GRANT REPLICATION SLAVE ON *.* TO rpl_user@'%' IDENTIFIED BY 'rpl_pass';
Query OK, 0 rows affected, 1 warning (0.00 sec)
Query OK, 0 rows affected (0.00 sec)
mysql> SET SQL_LOG_BIN=1;
Query OK, 0 rows affected (0.00 sec)
mysql> CHANGE MASTER TO MASTER_USER='rpl_user', MASTER_PASSWORD='rpl_pass' FOR CHANNEL 'group_replication_recovery';
Query OK, 0 rows affected, 2 warnings (0.03 sec)
mysql> INSTALL PLUGIN group_replication SONAME 'group_replication.so';
Query OK, 0 rows affected (0.01 sec)
mysql> START GROUP_REPLICATION;
Query OK, 0 rows affected (5.52 sec)
mysql> SELECT * FROM performance_schema.replication_group_members;
+---------------------------+--------------------------------------+-------------------+-------------+--------------+
| CHANNEL_NAME | MEMBER_ID | MEMBER_HOST | MEMBER_PORT | MEMBER_STATE |
+---------------------------+--------------------------------------+-------------------+-------------+--------------+
| group_replication_applier | d79c04bf-87a3-11e7-865f-0242ac130002 | mysql-mgr-server1 | 3306 | ONLINE |
| group_replication_applier | f7127f84-87a5-11e7-97af-0242ac130003 | mysql-mgr-server2 | 3306 | ONLINE |
+---------------------------+--------------------------------------+-------------------+-------------+--------------+
[root@iz2zec57gfl6i9vbtdksl1z ~]# docker exec -it s3-docker bash
root@mysql-mgr-server3:/# mysql -uroot -p123456
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.7.17-log MySQL Community Server (GPL)
Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> SET SQL_LOG_BIN=0;
Query OK, 0 rows affected (0.00 sec)
mysql> CREATE USER rpl_user@'%';
Query OK, 0 rows affected (0.00 sec)
mysql> GRANT REPLICATION SLAVE ON *.* TO rpl_user@'%' IDENTIFIED BY 'rpl_pass';
Query OK, 0 rows affected, 1 warning (0.00 sec)
Query OK, 0 rows affected (0.00 sec)
mysql> SET SQL_LOG_BIN=1;
Query OK, 0 rows affected (0.00 sec)
mysql> CHANGE MASTER TO MASTER_USER='rpl_user', MASTER_PASSWORD='rpl_pass' FOR CHANNEL 'group_replication_recovery';
Query OK, 0 rows affected, 2 warnings (0.03 sec)
mysql> INSTALL PLUGIN group_replication SONAME 'group_replication.so';
Query OK, 0 rows affected (0.01 sec)
mysql> START GROUP_REPLICATION;
Query OK, 0 rows affected (0.01 sec)
mysql> SELECT * FROM performance_schema.replication_group_members;
+---------------------------+--------------------------------------+-------------------+-------------+--------------+
| CHANNEL_NAME | MEMBER_ID | MEMBER_HOST | MEMBER_PORT | MEMBER_STATE |
+---------------------------+--------------------------------------+-------------------+-------------+--------------+
| group_replication_applier | d79c04bf-87a3-11e7-865f-0242ac130002 | mysql-mgr-server1 | 3306 | ONLINE |
| group_replication_applier | f7127f84-87a5-11e7-97af-0242ac130003 | mysql-mgr-server2 | 3306 | ONLINE |
| group_replication_applier | feeee99d-87a5-11e7-97cb-0242ac130004 | mysql-mgr-server3 | 3306 | ONLINE |
+---------------------------+--------------------------------------+-------------------+-------------+--------------+
2017-08-23T02:24:51.177878000Z 2017-08-23T02:24:51.175681Z 0 [Warning] Plugin group_replication reported: '[GCS] Connection attempt from IP address 172.19.0.4 refused. Address is not in the IP whitelist.'
2017-08-23T02:24:51.178024000Z 2017-08-23T02:24:51.175721Z 0 [ERROR] Plugin group_replication reported: '[GCS] Error connecting to the local group communication engine instance.'
2017-08-23T02:24:51.178176000Z 2017-08-23T02:24:51.175728Z 0 [Note] Plugin group_replication reported: 'state 4257 action xa_exit'
2017-08-23T02:24:51.178312000Z 2017-08-23T02:24:51.175798Z 0 [Note] Plugin group_replication reported: 'Exiting xcom thread'
2017-08-23T02:24:52.209910000Z 2017-08-23T02:24:52.209376Z 0 [ERROR] Plugin group_replication reported: '[GCS] The member was unable to join the group. Local port: 33061'
2017-08-23T02:25:51.176542000Z 2017-08-23T02:25:51.175539Z 3 [ERROR] Plugin group_replication reported: 'Timeout on wait for view after joining group'
2017-08-23T02:25:51.176898000Z 2017-08-23T02:25:51.175647Z 3 [Note] Plugin group_replication reported: 'Requesting to leave the group despite of not being a member'
2017-08-23T02:25:51.177142000Z 2017-08-23T02:25:51.175676Z 3 [ERROR] Plugin group_replication reported: '[GCS] The member is leaving a group without being on one.'
2017-08-23T02:25:51.179057000Z 2017-08-23T02:25:51.175896Z 3 [Note] Plugin group_replication reported: 'auto_increment_increment is reset to 1'
2017-08-23T02:25:51.179354000Z 2017-08-23T02:25:51.175905Z 3 [Note] Plugin group_replication reported: 'auto_increment_offset is reset to 1'
2017-08-23T02:25:51.179567000Z 2017-08-23T02:25:51.177979Z 15 [Note] Error reading relay log event for channel 'group_replication_applier': slave SQL thread was killed
2017-08-23T02:25:51.185216000Z 2017-08-23T02:25:51.184778Z 12 [Note] Plugin group_replication reported: 'The group replication applier thread was killed'
mysql> set global group_replication_ip_whitelist='172.19.0.0/24' ;
Query OK, 0 rows affected (0.00 sec)
2017-08-23T02:29:34.592161000Z 2017-08-23T02:29:34.590561Z 0 [Note] Plugin group_replication reported: 'state 4277 action xa_complete'
2017-08-23T02:29:34.592311000Z 2017-08-23T02:29:34.590696Z 0 [Note] Plugin group_replication reported: 'new state x_run'
2017-08-23T02:29:35.691341000Z 2017-08-23T02:29:35.689373Z 0 [ERROR] Plugin group_replication reported: 'This member has more executed transactions than those present in the group. Local transactions: feeee99d-87a5-11e7-97cb-0242ac130004:1-5 > Group transactions: aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1-8,
2017-08-23T02:29:35.691504000Z d79c04bf-87a3-11e7-865f-0242ac130002:1-5,
2017-08-23T02:29:35.691652000Z f7127f84-87a5-11e7-97af-0242ac130003:1-5'
2017-08-23T02:29:35.691806000Z 2017-08-23T02:29:35.689397Z 0 [ERROR] Plugin group_replication reported: 'The member contains transactions not present in the group. The member will now exit the group.'
2017-08-23T02:29:35.691957000Z 2017-08-23T02:29:35.689401Z 0 [Note] Plugin group_replication reported: 'To force this member into the group you can use the group_replication_allow_local_disjoint_gtids_join option'
mysql> show variables like 'group_replication_allow_local_disjoint_gtids_join';
+---------------------------------------------------+-------+
| Variable_name | Value |
+---------------------------------------------------+-------+
| group_replication_allow_local_disjoint_gtids_join | OFF |
+---------------------------------------------------+-------+
mysql> set global group_replication_allow_local_disjoint_gtids_join=1;
Query OK, 0 rows affected (0.00 sec)
mysql> START GROUP_REPLICATION;
Query OK, 0 rows affected (2.12 sec)