MySQL 8.0 master-slave replication with using Docker.
Previous version based on MySQL 5.7 is available:
in mysql5.7 branch. (see upstream)
make build
To run this examples you will need to start containers with "docker-compose" and after starting setup replication. See commands inside ./build.sh.
Create 3 MySQL containers with master-slaves STATEMENT-based replication1
make build
make master db=mydb sql="create table code(code int); insert into code values (100), (200)"
make slave1 db=mydb sql="select * from code \G"
make slave2 db=mydb sql="select * from code \G"
docker-compose logs
Go through "build.sh" and run command step-by-step.
make ps
make clean
make master_status
make slave1_status
make slave2_status
make master
make slave1
make slave2
Footnotes
-
https://dev.mysql.com/doc/refman/8.0/en/replication-formats.html Not using row for this project ↩