Move MySQL master

Posted by Noodles on Server Fault See other posts from Server Fault or by Noodles
Published on 2012-09-27T22:06:04Z Indexed on 2012/09/28 21:40 UTC
Read the original article Hit count: 130

Filed under:
|
|
|

I currently have a master db server (lets call it db1) and 6 slaves (slave1-6). I've setup a new server (db2) as a slave of db1 and it's in sync. I want to change all the slaves to use db2 instead of db1, but with minimal downtime/data loss.

At the moment the only way I can think of doing it is shutting down our website (so data stops being written to db1), waiting until all the slaves are up to date, flush logs on db1, shut it down. Reset master on db2, change all slaves to point to db2 with log position = 0.

Is this the right way to do it or is there a way to do it without taking the site offline?

© Server Fault or respective owner

Related posts about mysql

Related posts about replication