All the procedures explained previously also apply to multisource replication. The difference is that, with multisource replication, each slave associates each master-slave connection to a unique ID. This allows the replication commands and the configuration variables to refer to a particular master.
For example, we generally do not want to start or stop all the I/O threads, but only one of them.
Thus, all replication-related SQL statements support a parameter that specifies which connection they refer to. For example:
CHANGE MASTER 'connection_name' TO …
START SLAVE 'connection_name1' 'connection_name2'
STOP SLAVE 'connection_name1' 'connection_name2'
RESET SLAVE 'connection_name'
Also, it is possible to start or stop all the slave I/O threads using the following syntax:
START ALL SLAVES
STOP ALL SLAVES
When the connection name is not specified in a command, and the ALL
keyword is not present, the default connection is used. Initially, it is an empty string. It can be changed or read with the @@default_master_connection
server variable:
MariaDB [(none)]> SELECT @@default_master_connection; +-----------------------------+ | @@default_master_connection | +-----------------------------+ | | +-----------------------------+ 1 row in set (0.00 sec)
Also the variables used for filtering connections, by default, refer to the default connection. The following syntax can be used to specify a filter for a certain connection:
connection_name.variable_name
For example, to only replicate db
via the connection master1
and all databases via other connections, we can use:
SET GLOBAL master1.replicate_do_db = '';