Assume that the masters are master1 and master2.
Steps:
- Set up replication between master1 and master2 as described in Chapter 9, Replication.
- Make master2 read-only:
mysql> SET @@GLOBAL.READ_ONLY=ON;
- On master2, check the current binary log coordinate.
mysql> SHOW MASTER STATUS;+----------------+----------+--------------+------------------+-------------------+| File | Position | Binlog_Do_DB | Binlog_Ignore_DB | Executed_Gtid_Set |+----------------+----------+--------------+------------------+-------------------+| server1.000017 | 473 | | | |+----------------+----------+--------------+------------------+-------------------+1 row in set (0.00 sec)
From the preceding output, you can start the replication on master1 from ...