MySQL master slave replica interrupts after service restart or reboot



  • I've been using the master slave replica to keep a mySQL database and its disaster recovery perfectly aligned.

    I noticed that unfortunately every time the mySQL service restarts, or one of the server is rebooted, the replica stops to work and I need to reactivate it manually.

    Maybe this behavior is normal and acceptable in some kind of scenario, but in a real working environment this is not reliable and sustainable.

    I need to understand if there is any option to avoid this interruption, or some way to automatize the restart. When I launch the "show master status" command, I noticed that the master log file ("file" column) is incremental, but the master log position ("position" column) is not. Is there any way to control these parameters? Or is there any other reliable process more than master slave replica, in a mySQL environment?

    Many thanks in advance, Kind regards

    P.S. I'm aware there are similar questions on the website, but this topic it's still unclear to me, apologies.



  • If you look at https://dev.mysql.com/doc/refman/8.0/en/show-replica-status.html , (formerly https://dev.mysql.com/doc/refman/5.7/en/show-slave-status.html ), you will see a Connect_Retry: defaulting to 60 seconds. It should reconnect after this interval.

    This MASTER_CONNECT_RETRY is part of the https://dev.mysql.com/doc/refman/5.7/en/change-master-to.html syntax.




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2