Paulo Bueno
Paulo Bueno

Reputation: 2569

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.

Upvotes: 4

Views: 6762

Answers (1)

Maxime Pacary
Maxime Pacary

Reputation: 23001

  • 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

Upvotes: 3

Related Questions