I am currently setting up a call center system (Vicidial) having a Master DB and a Slave DB. When the Master would go down, I have made a script on the SlaveDB that would execute "stop slave" on the slave mysql service and make it as a new master by pointing the other servers (Web, Dialer, Archive) to the slave as their new Master database server.
When the master is up again, I would run another script on the SlaveDB that would point the servers back to the original MasterDB and would let the slave DB become slave again to the original MasterDB by executing "start slave".
My question is ~ If there are new data added on the New Master while the original master is down, how do I replicate this data to the original master when it goes back up before I start demoting the new master to slave again?
Answers and advice/constructive criticisms will be much appreciated.
P.S. I am a newbie in Databases and scripting.
Thanks in advance!