I have a very simple webapp infra: FE => BE => MySQL. I have set up MySQL master-slave replication successfully. If my MySQL master node is down, I can manually point the MySQL IP to the Slave node in my BE. Users can insert data into the table with no problem. But I cannot re-sync the data backup to the master node after I bring the master node up. So far I tried 2 methods but both of them don't work:
- Restart the Master node and reset the Slave node.
- Switch over the role of them, change original Slave to Master, original Master to Slave.
If the Master is down, how do I re-sync the data back to Master from Salve after Master is back to normal? In my case, do I have to copy the data from Slave to Master by mysqldump before re-sync?
I am very new to MySQL, any help is appreciated!