MySQL Group Replication between hosts running docker is not working
Posted by: Steven Glogger
Date: July 14, 2020 02:52PM

Hi there,

I'm trying to get MySQL Group Replication running which are trying to replicate between two hosts. Each host having a docker-container running.

(host1)----{network}----(host2)

host1/host2 have a LAN address of 10.x.x.x/24 and a WAN address of 198.x.x.x
they have full connectivity.

both sides have docker configured via docker-compose like this:

# cat docker-compose.yml
version: "3.3"

services:

mysqldb:
image: mysql/mysql-server:8.0
container_name: mysqldb
command: ["mysqld",
"--server-id=99",
"--log-bin=mysql-bin.log",
"--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",
"--loose-group-replication-start-on-boot=OFF",
"--loose-group_replication_bootstrap_group=ON",
"--loose-group-replication-group-name=aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
"--loose-group-replication-local-address=198.18.186.1:33061",
"--loose-group-replication-group-seeds=198.19.84.1:33061",
"--loose-group-replication-single-primary-mode=OFF",
"--loose-group-replication-enforce-update-everywhere-checks=ON"]
env_file:
- ./secret-mysql.env
healthcheck:
test: "mysqladmin ping -u root -p$${MYSQL_ROOT_PASSWORD}"
interval: 2s
retries: 20
ports:
- 3306:3306
- 33061:33061
network_mode: "host"
restart: unless-stopped
volumes:
- /data/var/mysqldb/:/var/lib/mysql

what differs is of course server-id (unique), GR local address and group seeds.


once I start on 'host1' i get:
+---------------------------+--------------------------------------+-------------+-------------+--------------+-------------+----------------+
| CHANNEL_NAME | MEMBER_ID | MEMBER_HOST | MEMBER_PORT | MEMBER_STATE | MEMBER_ROLE | MEMBER_VERSION |
+---------------------------+--------------------------------------+-------------+-------------+--------------+-------------+----------------+
| group_replication_applier | 18dcf18a-c60d-11ea-87c9-000c294b79b0 | host1 | 3306 | ONLINE | PRIMARY | 8.0.21 |
+---------------------------+--------------------------------------+-------------+-------------+--------------+-------------+----------------+

>2020-07-14T20:24:47.588152Z 0 [System] [MY-011503] [Repl] Plugin group_replication reported: 'Group membership changed to host1:3306 on view 15947582865872850:1.'



and 'host2' gets another member-id - looks like another group:
+---------------------------+--------------------------------------+-------------+-------------+--------------+-------------+----------------+
| CHANNEL_NAME | MEMBER_ID | MEMBER_HOST | MEMBER_PORT | MEMBER_STATE | MEMBER_ROLE | MEMBER_VERSION |
+---------------------------+--------------------------------------+-------------+-------------+--------------+-------------+----------------+
| group_replication_applier | ce79c45b-c605-11ea-a04d-000c29d4b84a | host2 | 3306 | ONLINE | PRIMARY | 8.0.21 |
+---------------------------+--------------------------------------+-------------+-------------+--------------+-------------+----------------+

> 2020-07-14T19:11:55.445122Z 0 [System] [MY-011503] [Repl] Plugin group_replication reported: 'Group membership changed to host2:3306 on view 15947539144442389:1.'



I've tried also:
- instead of 198 address using the 10.x
- putting "privileged: true to docker-compose.yml
- working without network_mode:host
- mysql... -e "SET GLOBAL group_replication_ip_whitelist='10.0.0.0/8,198.18.0.0/15';" \


when I sniff traffic (tcpdump) on the secondary node, I dont see any communication going out.

any clue what's wrong here?

greetings
-steven

Options: ReplyQuote


Subject
Written By
Posted
MySQL Group Replication between hosts running docker is not working
July 14, 2020 02:52PM


Sorry, only registered users may post in this forum.

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.