how to create master-master replication MySQL using mysqlbinlog and rsync

From : Server-1 :  master and Server-2 :  slave

To : Server-1 : master-1 and slave-2, Server-2 : master-2 and slave-1

follow this command in my.cnf server 1 master

follow this command in my.cnf server 2 slave

then create user "slaveuser" on both server and give grants

then rsync mysql dir to directory mysql slave server, before this stop mysql service first in destination and backup basedir

do block write in server 1 for all tables and then re-rsync again to get delta data from server 1

then run this

that information which we will write to server 2

in server 2, run this command and start mysql service

and login to mysql command line, follow this command

because we will create master master replication, do the same thing in server 1. 

do block write in server 2 for all tables and run this command in server 2

follow this command and unlock tables

and then start slave on both server, open mysql command line and run this command

make sure you see this 

Posting Komentar

Lebih baru Lebih lama