mysql-group-replication-docker icon indicating copy to clipboard operation
mysql-group-replication-docker copied to clipboard

ERROR 3096 (HY000): The START GROUP_REPLICATION command failed as there was an error when initializing the group communication layer.

Open Nihal987 opened this issue 2 years ago • 6 comments

Hi @wagnerjfr, Sorry to raise another issue so soon. When I was trying the following steps I got an error at the "START GROUP_REPLICATION;" step on node1. I checked the other medium article as well this time but it seems to be the same set of instructions. I've also tried to reproduce this on another system(Linux and MacOS) and I was getting the same error.

mysql> START GROUP_REPLICATION;
ERROR 3096 (HY000): The START GROUP_REPLICATION command failed as there was an error when initializing the group communication layer.

Nihal987 avatar Aug 09 '23 17:08 Nihal987

Hi @Nihal987 no problem, so you have the 3 nodes started and what else did you do until the error?

wagnerjfr avatar Aug 09 '23 18:08 wagnerjfr

Yes I have the 3 nodes. And then I just ran each of the SQL commands one by one. They all worked except the 'START GROUP_REPLICATION' command.

So basically inside the node1 docker container, these commands

SET @@GLOBAL.group_replication_bootstrap_group=1;
create user 'repl'@'%';
GRANT REPLICATION SLAVE ON *.* TO repl@'%';
flush privileges;
change master to master_user='repl' for channel 'group_replication_recovery';

And then finally

START GROUP_REPLICATION;

Nihal987 avatar Aug 09 '23 18:08 Nihal987

Ok, but did you follow the steps like?

node1

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;"

node2 and node 3

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

wagnerjfr avatar Aug 09 '23 18:08 wagnerjfr

Sorry I should have clarified. Initially yes, I ran the commands as is, but I got an error on node1 while running the exec command. I never reached the commands for node2 and node3. So in order to debug I reset my environment (stopped and removed the dockers and started them again) and then ran each of the SQL commands one by one to see what exactly was failing in node1.

Nihal987 avatar Aug 09 '23 18:08 Nihal987

@Nihal987 Not sure now what is the problem.. Are you waiting the nodes to be healthy? The best I can do is to share this Youtube Video exactly what I'm doing which I just uploaded.

If you have docker-compose, you can also try the other tutorial and compare.

wagnerjfr avatar Aug 09 '23 20:08 wagnerjfr

Thank you for the video! I can't seem to figure out why it isn't working for me, but if/when I fix the issue I'll post it here.

Nihal987 avatar Aug 09 '23 23:08 Nihal987