These steps assume you have enabled GTIDs for transactions on the
created a replication user, ensured that the slave is using
TABLE based replication repositories, and
provisioned the slave with data from the masters if appropriate.
CHANGE MASTER TO statement
to configure a replication channel for each master on the
replication slave (see Section 5.3, “Replication Channels”).
FOR CHANNEL clause is used to specify the
channel. For GTID-based replication, GTID auto-positioning is used
to synchronize with the master (see
Section 2.3.3, “GTID Auto-Positioning”). The
MASTER_AUTO_POSITION option is set to specify
the use of auto-positioning.
For example, to add
master2 as masters to the replication slave,
use the mysql client to issue the
CHANGE MASTER TO statement twice on
the slave, like this:
mysql> CHANGE MASTER TO MASTER_HOST="master1", MASTER_USER="ted", \ MASTER_PASSWORD="password", MASTER_AUTO_POSITION=1 FOR CHANNEL "master_1"; mysql> CHANGE MASTER TO MASTER_HOST="master2", MASTER_USER="ted", \ MASTER_PASSWORD="password", MASTER_AUTO_POSITION=1 FOR CHANNEL "master_2";