Documentation Home
MySQL Replication
Related Documentation Download this Excerpt
PDF (US Ltr) - 1.4Mb
PDF (A4) - 1.4Mb
HTML Download (TGZ) - 369.1Kb
HTML Download (Zip) - 383.5Kb


MySQL Replication  /  ...  /  Adding a GTID Based Master to a Multi-Source Replication Slave

2.4.2.2 Adding a GTID Based Master to a Multi-Source Replication Slave

This section assumes you have enabled GTID based transactions on the master using gtid_mode=ON, enabled a replication user, and ensured that the slave is using TABLE based replication repositories. Use the CHANGE MASTER TO statement to add a new master to a channel by using a FOR CHANNEL channel clause. For more information on replication channels, see Section 5.3, “Replication Channels”

For example, to add a new master with the host name master1 using port 3451 to a channel called master-1:

CHANGE MASTER TO MASTER_HOST='master1', MASTER_USER='rpl', MASTER_PORT=3451, MASTER_PASSWORD='', \
MASTER_AUTO_POSITION = 1 FOR CHANNEL 'master-1';

Multi-source replication is compatible with auto-positioning. See CHANGE MASTER TO Syntax for more information.

Repeat this process for each extra master that you want to add to a channel, changing the host name, port and channel as appropriate.