Posted on

Mysql Circular replication

Node 1 is master for node2 , node 2 is the master to node 3 , node 3 is master for node1

Node 1 configuration

node 1 my.cnf configuration

server-id       =1
log_bin         =mysql-bin
binlog_do_db    =details
log-slave-updates

create replication account for node 2

create user 'repl'@'%' identified by 'mysqluser';
grant replication slave on *.* to 'repl'@'%';

CHANGE MASTER TO
MASTER_HOST='NODE3-IP',
MASTER_USER='repl',
MASTER_PASSWORD='mysqluser',
MASTER_LOG_FILE='mysql-bin.XXXXX',
MASTER_LOG_POS=XXX;

lock databases and dump to fils , and copy to node 2 , node 3

Node 2 configuration

node 2 my.cnf configuration

server-id       =2
log_bin         =mysql-bin
binlog_do_db    =details
log-slave-updates

node 3 my.cnf configuration

server-id       =3
log_bin         =mysql-bin
binlog_do_db    =details
log-slave-updates