1

We need to resize the size (CPU and RAM) of two database servers having MySQL server 8: master and slave, but this operation implies that those machines will be restarted, And I think a restart of those machines might cause a problem in replication !

Is there a proper way to restart our machines without breaking the replication, Or I'm wrong about the fact that restarting the master and slave machines (OS) can break the replication ?

2

You can stop and start master and slave in any order you want. It doesn't matter, master first or slave first - for both stop and start.

The only requirement is master's expire_log_days config option should be bigger than maintenance duration. Otherwise master on start will rotate its binlogs faster than slave get a sync. Keep in mind that this variable should be set statically in the my.cnf file, not dynamically via SET GLOBAL expire_log_days = X;

4
  • 1
    (See also binlog_expire_logs_seconds)
    – Rick James
    Aug 12 at 18:53
  • Thank you, i didn't mention that we have a cronjob that move binlogs from their location in the master , I have to stop this cronjob before, right ?
    – Hamza AZIZ
    Aug 13 at 7:05
  • @HamzaAZIZ Right. You need exactly the same layout for master after restart at least until slave will be synced.
    – Kondybas
    Aug 14 at 17:08
  • okay thank you @Kondybas
    – Hamza AZIZ
    Aug 14 at 18:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.