O'Reilly logo

MySQL 8 Cookbook by Karthik Appigatla

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

How to do it...

If the replication is already set up between the servers, follow these steps:

  1. Enable GTIDs in my.cnf:
shell> sudo vi /etc/my.cnf[mysqld]gtid_mode=ONenforce-gtid-consistency=trueskip_slave_start
  1. Set the master as read-only and make sure that all the slaves catch up with the master. This is very important because there should not be any data inconsistency between master and slaves:
On mastermysql> SET @@global.read_only = ON;On Slaves (if replication is already setup)mysql> SHOW SLAVE STATUS\G
  1. Restart all the slaves to put GTID into effect. Since the skip_slave_start is given in the configuration file, the slave won't start until you specify the START SLAVE command. If you start the slave, it will fail with this error— ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required