Mysql Replication Problem

I have a problem with Mysql replication
I have 2 Database servers 1 Master and 1 Slave When Replication is running then Master and Slave are disconnected so that the data on the two servers is inconsistent, my question is

  1. How can when Master and Slave are disconnected they can be reconnected automatically?

  2. How to do if the data has been reconnected in the Master and Slave is consistent again?

  3. Apart from replication, what methods can make the Mysql Database server High Availability, for example 1 DB Server is in Jakarta (DC) 1 Database server is in another country (DRC)? and how to implement it? all on premise Thank you

Hi @Riyon_Amisela thank you for posting to the Percona forums, welcome!!

  1. By default MySQL replicas (slaves) will automatically attempt to reconnect to their Primary (master/source). They do this by retrying their connections in the event of network failures, or host restarts etc. MySQL :: MySQL 8.0 Reference Manual :: Replica Server Options and Variables
  2. If you have had your replica stopped for a while, simply starting replication should catch the replica up with the primary automatically. If you suspect you have changed data on the replica, you can use a tool such as pt-table-checksum in order to determine the breadth and scope of the data differences. pt-table-checksum
  3. Using asynchronous replication is probably the best HA you can achieve if you have your databases in different countries. MySQL :: MySQL 8.0 Reference Manual :: 17 Replication
1 Like