Configure BiDirectional MySQL Replication (Master-Master)
Configure BiDirectional MySQL Replication (Master-Master) Now a days HA(High Availability) and DR(Disaster Recovery) Solutions are mandatory and required for mission critical databases. In MySQL world , DR solution are provided using the Replication (Master-Master). In this blog, We will discuss about setting up new Master-Master setup. 1) Preparing Master Server 1(mysqlmaster01) : 1.a) Make Changes in my.cnf file. cp -pr /etc/my.cnf /etc/my.cnf_<ddmmyyyy> Add below lined to my.cnf vi /etc/my.cnf server-id=1 log-bin gtid_mode=ON enforce-gtid-consistency auto-increment-increment = 2 auto-increment-offset = 1 expire_logs_days = 10 relay-log = /var/lib/mysql/relaylog/mysql-relay relay-log-recovery binlog_format=mixed replicate-do-db=mysqldb 1.b) Restart MYSQL server to make changed effective. service mysqld restart 1.c) Verify binary logs: SHOW MASTER LOGS; Show master Status; ls -lrt /var/log/*bin* 1.d) Create Replication user in Master Server 1:...