MySQL Forums
Forum List  »  Replication

Re: need help for version 8.0.15 group replicaton
Posted by: Wagner Franchin
Date: March 15, 2019 05:23AM

Hi Winsun,

I wasn't able to reproduce the issue.

Check my steps below:

wfranchi@computer:~$ for N in 1 2 3
> do docker run -d --name=node$N --net=groupnet --hostname=node$N \
> -e MYSQL_ROOT_PASSWORD=mypass \
> mysql/mysql-server:8.0.15 \
> --server-id=$N \
> --log-bin=binlog \
> --relay-log=node$N-relay-bin \
> --binlog-format=ROW \
> --enforce-gtid-consistency='ON' \
> --log-slave-updates='ON' \
> --gtid-mode='ON' \
> --transaction-write-set-extraction='XXHASH64' \
> --binlog-checksum='NONE' \
> --master-info-repository='TABLE' \
> --relay-log-info-repository='TABLE' \
> --plugin-load='group_replication.so' \
> --relay-log-recovery='ON' \
> --group-replication-start-on-boot='OFF' \
> --group-replication-group-name='aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee' \
> --group-replication-local-address="node$N:33061" \
> --group-replication-group-seeds='node1:33061,node2:33061,node3:33061'
> done
f934008c98b30f7eb696fc1088b6881f4d8e329d7a2d088e2e3b2388499a1f16
8dda0dc7a1b9d0c04eea30640736f061bfc42a0c010af9809f578e0b2658baa0
e492dd28e84b1afb767bc03d72138143bfe387c98867a8c8476379e873163faf

wfranchi@computer:~$ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
e492dd28e84b mysql/mysql-server:8.0.15 "/entrypoint.sh --se…" 6 seconds ago Up 4 seconds (health: starting) 3306/tcp, 33060/tcp node3
8dda0dc7a1b9 mysql/mysql-server:8.0.15 "/entrypoint.sh --se…" 8 seconds ago Up 6 seconds (health: starting) 3306/tcp, 33060/tcp node2
f934008c98b3 mysql/mysql-server:8.0.15 "/entrypoint.sh --se…" 9 seconds ago Up 8 seconds (health: starting) 3306/tcp, 33060/tcp node1

wfranchi@computer:~$ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
e492dd28e84b mysql/mysql-server:8.0.15 "/entrypoint.sh --se…" About a minute ago Up 59 seconds (healthy) 3306/tcp, 33060/tcp node3
8dda0dc7a1b9 mysql/mysql-server:8.0.15 "/entrypoint.sh --se…" About a minute ago Up About a minute (healthy) 3306/tcp, 33060/tcp node2
f934008c98b3 mysql/mysql-server:8.0.15 "/entrypoint.sh --se…" About a minute ago Up About a minute (healthy) 3306/tcp, 33060/tcp node1

wfranchi@computer:~$ docker exec -it node1 mysql -uroot -pmypass \
> -e "SET @@GLOBAL.group_replication_bootstrap_group=1;" \
> -e "create user 'repl'@'%';" \
> -e "GRANT REPLICATION SLAVE ON *.* TO repl@'%';" \
> -e "flush privileges;" \
> -e "change master to master_user='repl' for channel 'group_replication_recovery';" \
> -e "START GROUP_REPLICATION;" \
> -e "SET @@GLOBAL.group_replication_bootstrap_group=0;" \
> -e "SELECT * FROM performance_schema.replication_group_members;"
mysql: [Warning] Using a password on the command line interface can be insecure.
+---------------------------+--------------------------------------+-------------+-------------+--------------+-------------+----------------+
| CHANNEL_NAME | MEMBER_ID | MEMBER_HOST | MEMBER_PORT | MEMBER_STATE | MEMBER_ROLE | MEMBER_VERSION |
+---------------------------+--------------------------------------+-------------+-------------+--------------+-------------+----------------+
| group_replication_applier | 956cb149-418d-11e9-a833-0242ac130002 | node1 | 3306 | RECOVERING | SECONDARY | 8.0.15 |
+---------------------------+--------------------------------------+-------------+-------------+--------------+-------------+----------------+

wfranchi@computer:~$ for N in 2 3
> do docker exec -it node$N mysql -uroot -pmypass \
> -e "change master to master_user='repl' for channel 'group_replication_recovery';" \
> -e "START GROUP_REPLICATION;"
> done
mysql: [Warning] Using a password on the command line interface can be insecure.
mysql: [Warning] Using a password on the command line interface can be insecure.

wfranchi@computer:~$ docker exec -it node1 mysql -uroot -pmypass \
> -e "SELECT * FROM performance_schema.replication_group_members;"
mysql: [Warning] Using a password on the command line interface can be insecure.
+---------------------------+--------------------------------------+-------------+-------------+--------------+-------------+----------------+
| CHANNEL_NAME | MEMBER_ID | MEMBER_HOST | MEMBER_PORT | MEMBER_STATE | MEMBER_ROLE | MEMBER_VERSION |
+---------------------------+--------------------------------------+-------------+-------------+--------------+-------------+----------------+
| group_replication_applier | 956cb149-418d-11e9-a833-0242ac130002 | node1 | 3306 | ONLINE | PRIMARY | 8.0.15 |
| group_replication_applier | 96d53dd7-418d-11e9-a3d9-0242ac130003 | node2 | 3306 | ONLINE | SECONDARY | 8.0.15 |
| group_replication_applier | 9783f50c-418d-11e9-9ffc-0242ac130004 | node3 | 3306 | ONLINE | SECONDARY | 8.0.15 |
+---------------------------+--------------------------------------+-------------+-------------+--------------+-------------+----------------+

wfranchi@computer:~$ docker kill node3
node3

wfranchi@computer:~$ docker exec -it node1 mysql -uroot -pmypass -e "SELECT * FROM performance_schema.replication_group_members;"
mysql: [Warning] Using a password on the command line interface can be insecure.
+---------------------------+--------------------------------------+-------------+-------------+--------------+-------------+----------------+
| CHANNEL_NAME | MEMBER_ID | MEMBER_HOST | MEMBER_PORT | MEMBER_STATE | MEMBER_ROLE | MEMBER_VERSION |
+---------------------------+--------------------------------------+-------------+-------------+--------------+-------------+----------------+
| group_replication_applier | 956cb149-418d-11e9-a833-0242ac130002 | node1 | 3306 | ONLINE | PRIMARY | 8.0.15 |
| group_replication_applier | 96d53dd7-418d-11e9-a3d9-0242ac130003 | node2 | 3306 | ONLINE | SECONDARY | 8.0.15 |
| group_replication_applier | 9783f50c-418d-11e9-9ffc-0242ac130004 | node3 | 3306 | ONLINE | SECONDARY | 8.0.15 |
+---------------------------+--------------------------------------+-------------+-------------+--------------+-------------+----------------+

wfranchi@computer:~$ docker exec -it node1 mysql -uroot -pmypass -e "SELECT * FROM performance_schema.replication_group_members;"
mysql: [Warning] Using a password on the command line interface can be insecure.
+---------------------------+--------------------------------------+-------------+-------------+--------------+-------------+----------------+
| CHANNEL_NAME | MEMBER_ID | MEMBER_HOST | MEMBER_PORT | MEMBER_STATE | MEMBER_ROLE | MEMBER_VERSION |
+---------------------------+--------------------------------------+-------------+-------------+--------------+-------------+----------------+
| group_replication_applier | 956cb149-418d-11e9-a833-0242ac130002 | node1 | 3306 | ONLINE | PRIMARY | 8.0.15 |
| group_replication_applier | 96d53dd7-418d-11e9-a3d9-0242ac130003 | node2 | 3306 | ONLINE | SECONDARY | 8.0.15 |
| group_replication_applier | 9783f50c-418d-11e9-9ffc-0242ac130004 | node3 | 3306 | UNREACHABLE | SECONDARY | 8.0.15 |
+---------------------------+--------------------------------------+-------------+-------------+--------------+-------------+----------------+

wfranchi@computer:~$ docker exec -it node1 mysql -uroot -pmypass -e "SELECT * FROM performance_schema.replication_group_members;"
mysql: [Warning] Using a password on the command line interface can be insecure.
+---------------------------+--------------------------------------+-------------+-------------+--------------+-------------+----------------+
| CHANNEL_NAME | MEMBER_ID | MEMBER_HOST | MEMBER_PORT | MEMBER_STATE | MEMBER_ROLE | MEMBER_VERSION |
+---------------------------+--------------------------------------+-------------+-------------+--------------+-------------+----------------+
| group_replication_applier | 956cb149-418d-11e9-a833-0242ac130002 | node1 | 3306 | ONLINE | PRIMARY | 8.0.15 |
| group_replication_applier | 96d53dd7-418d-11e9-a3d9-0242ac130003 | node2 | 3306 | ONLINE | SECONDARY | 8.0.15 |
+---------------------------+--------------------------------------+-------------+-------------+--------------+-------------+----------------+

wfranchi@computer:~$ docker exec -it node1 mysql -uroot -pmypass -e "create database TEST; use TEST; CREATE TABLE t1 (id INT NOT NULL PRIMARY KEY, title VARCHAR(255) NOT NULL) ENGINE=InnoDB; show tables;"
mysql: [Warning] Using a password on the command line interface can be insecure.
+----------------+
| Tables_in_TEST |
+----------------+
| t1 |
+----------------+

wfranchi@computer:~$ docker exec -it node1 mysql -uroot -pmypass -e "INSERT INTO TEST.t1 VALUES(2,'hws2');"
mysql: [Warning] Using a password on the command line interface can be insecure.

wfranchi@computer:~$ for N in 1 2
> do docker exec -it node$N mysql -uroot -pmypass \
> -e "SHOW VARIABLES WHERE Variable_name = 'hostname';" \
> -e "SELECT * FROM TEST.t1;"
> done
mysql: [Warning] Using a password on the command line interface can be insecure.
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| hostname | node1 |
+---------------+-------+
+----+-------+
| id | title |
+----+-------+
| 2 | hws2 |
+----+-------+
mysql: [Warning] Using a password on the command line interface can be insecure.
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| hostname | node2 |
+---------------+-------+
+----+-------+
| id | title |
+----+-------+
| 2 | hws2 |
+----+-------+

wfranchi@computer:~$

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: need help for version 8.0.15 group replicaton
423
March 15, 2019 05:23AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.