MySQL 复制 - 多个主服务器(不同 d/bs)复制到同一个从服务器

MySQL Replication - multiple masters (different d/bs) replicated to same slave server

我有一个 MySQL 复制设置并且 运行:

数据库A(服务器1为主)-->数据库A(服务器Z,作为从)

我现在想用同一个Slave Server(Z)做另外两个数据库的slave;完全不同的数据库(例如 B 和 C),如果是数据库 A,则不是其他副本。

我遵循了这个简单的指南: https://www.digitalocean.com/community/tutorials/how-to-set-up-master-slave-replication-in-mysql

但是在/etc/my.cnf中将第二个数据库添加到从服务器时,我看不出有多个配置文件怎么可能。

基本上我想我需要在从属服务器上 my.cnf 中的这两个块,但它不会那么简单,对吗?

log_error="/var/log/mysql/error.log"
server-id=2
log_bin="/var/log/mysql/mysql-bin.log"
binlog_do_db=database_a

log_error="/var/log/mysql/error.log"
server-id=3
log_bin="/var/log/mysql/mysql-bin.log"
binlog_do_db=database_b

这可能吗,或者我真的需要为我想要复制的每个唯一数据库准备一个新的从属服务器吗?

是否可以在从服务器上为每个数据库设置特定的 conf 文件,例如/etc/databasea.cnf 和 /etc/databaseb.cnf 以便我可以为每个数据库指定不同的设置?

提前致谢

多源复制仅在 MySQL 5.7.6 或 MariaDB 10.0.1 开始可用。

Multi-Source Replication enables a replication slave to receive transactions from multiple sources simultaneously. Multi-source replication can be used to back up multiple servers to a single server, to merge table shards, and consolidate data from multiple servers to a single server. Multi-source replication does not implement any conflict detection or resolution when applying the transactions, and those tasks are left to the application if required. In a multi-source replication topology, a slave creates a replication channel for each master that it should receive transactions from.

来源: