One Master, Two Slaves – Daisy Chaining MySQL
The crucial detail is log_slave_updates = 1 on the first slave to be able to pass on the replication updates to the next machine in the chain.
Master config:
server-id = 1
binlog_do_db =my_database
log_bin = /var/log/mysql/mysql-bin.log
expire_logs_days = 10
max_binlog_size = 100M
binlog-format = ROW
Middle slave:
server-id = 2
replicate-do-db=my_database
log_bin = /var/log/mysql/mysql-bin.log
log_slave_updates = 1
expire_logs_days = 10
max_binlog_size = 100M
binlog-format = ROW
Last slave:
server-id = 3
replicate-do-db=my_database
The replication script can be used to setup the actual replication itself.
Related Posts
Tags: mysql, replication