MySQL is a single master with multiple databases replicating to multiple slaves

Well, I'm just checking, but I think I made a mistake.

I have one instance of a MySQL server that contains several databases.

I need to replicate each of these databases to another slave device.

more clearly:

DB1 on Server1 replicates on Slave1 DB2 on Server1 replicates on Slave2 ... DBn on Server1 replicates on Slave'n 

* Server1 value = separate MySQL instance.

So what are the options?

  • Create multiple instances of master / server and then replicate its corresponding slave?

     [DB1 on Server1 replicates on Slave1] [DB2 on Server2 replicates on Slave2]... 
  • Replicate all databases in bin.log and then filter on the slave configuration?

  • Is it possible to install multiple bin.log on the same server for each slave?

Without the above three, is there another (better) aproach?

thanks.

+4
source share
1 answer
  • Approach No. 1 will require much more work and maintenance.

  • Approach No. 3 is impossible AFAIK.

  • Then I would go for approach No. 2: one master, several slaves, with binlog filtering on each slave.

Each slave device has the following filter in its my.cnf file:

 replicate-wild-do-table = DBn.% 

See: http://dev.mysql.com/doc/refman/5.1/en/replication-solutions-partitioning.html

+2
source

Source: https://habr.com/ru/post/1382735/


All Articles