I have a two node MySQL cluster with Master Slave replication. The MySQL version is 5.7.22 and the OS is CentOS.

I need to upgrade the MySQL version to 5.7.24 due to some security reasons.

However, I need to

  • keep the existing data
  • keep the existing user privileges
  • do with a zero downtime
  • keep the master slave replication after upgrading

What would be the correct approach to do this with the above requirements.

1 Answer 1

  1. Upgrade the slave -- This will have the Slave offline for minute(s). This step may include mysql_upgrade.
  2. Change the configuration to be Master-Master -- binlog, log_slave_updates, etc, on both servers.
  3. Failover -- This will have the Master offline for minute(s). This also involves getting writing clients to point at the new Master. (Presumably, you already have failover procedures in place and tested.)
  4. Upgrade the former Master (now the Slave)

Optionally failback.

With only 2 nodes there will be short downtimes. With some more advanced clustering techniques, plus a proxy, the downtime is less. But never absolute zero. See Group Replication or Galera.

You may as well leave it Master-Master instead of Master-Slave. This avoids needing to do step 2 again. However, you should set the Master that is not being written to to read_only.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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