To start you have to up docker containers:
docker-compose up -d
-
docker exec -it mysql-master bash
-
mysql -uroot -ptest test
-
GRANT REPLICATION SLAVE ON . TO 'slave'@'%' IDENTIFIED BY 'test';
-
-
docker exec -it mysql-slave1 bash
-
mysql -uroot -ptest test
-
CHANGE MASTER TO MASTER_HOST='mysql-master', MASTER_USER='slave', MASTER_PASSWORD='test', MASTER_LOG_FILE = 'mysql-bin.000001', MASTER_LOG_POS = 1321;
-
START SLAVE;
-
After creation table and some inserts I insert data to mysql-slave2 server and broke synchronization.
All required queries in master.sql and slave.sql files.