简体   繁体   中英

MySQL single master with multiple databases replicating on multiple slaves

Well i'm just checking but i guess i've commited a mistake.

I've a single MySQL server instance running wich contains several databases.

What i need is to replicate each of these databases to a diferent slave.

more clearly:

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

*Meaning Server1 = single MySQL instance.

So what are the options?

  1. Create multiple instances of master/server and replicate then with its corresponding slave?

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

  3. Is it possible to setup several bin.logs on the same server for each slave?

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

Thx.

  • Approach #1 would require much more work and maintenance.

  • Approach #3 is not possible AFAIK.

  • I would then go for the approach #2: single master, several slaves, with binlog filtering on each slave.

Each slave would have, in its my.cnf file, the following filter:

replicate-wild-do-table = DBn.%

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM