Quantcast
Channel: StackExchange Replication Questions
Viewing all articles
Browse latest Browse all 17268

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

$
0
0

I have a MySQL Replication setup up and running:

Database A (Server 1 as master) --> Database A (Server Z, acting as the slave)

I now want to use the same Slave Server (Z) to be a slave of two other databases; totally different databases (e.g. B and C), not other copies if Database A.

I've followed this simple guide: https://www.digitalocean.com/community/tutorials/how-to-set-up-master-slave-replication-in-mysql

But when it comes to adding the second database to the slave server in /etc/my.cnf, I don't see how it's possible to have more than one profile.

Basically I am thinking I need both of these blocks in my.cnf on the slave server but it won't be that simple, right?

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

Is it possible, or do I literally need a new slave server for each unique database I want to replicate?

Is it possible to, on the slave server, have specific conf files for each database, e.g. /etc/databasea.cnf and /etc/databaseb.cnf so I can specify different settings for each database?

Thanks in advance


Viewing all articles
Browse latest Browse all 17268

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>