Chinaunix首页 | 论坛 | 博客
  • 博客访问: 104841974
  • 博文数量: 19283
  • 博客积分: 9968
  • 博客等级: 上将
  • 技术积分: 196062
  • 用 户 组: 普通用户
  • 注册时间: 2007-02-07 14:28
文章分类

全部博文(19283)

文章存档

2011年(1)

2009年(125)

2008年(19094)

2007年(63)

分类: Mysql/postgreSQL

2008-04-19 17:13:29

作者:lg    来自:

3.使用不同的数据库复制到不同的slave
You can achieve this separation by configuring the master and slaves as normal, and then limiting the binary log statements that each slave processes by using the replicate-wild-do-table configuration option on each slave.

you would configure each slave as follows before enabling replication using START SLAVE:

MySQL Slave 1 should have the following configuration options:

replicate-wild-do-table=sales.%
replicate-wild-do-table=finance.%MySQL Slave 2 should have the following configuration option:

replicate-wild-do-table=support.%MySQL Slave 3 should have the following configuration option:

replicate-wild-do-table=service.%If you have data that needs to be synchronized to the slaves before replication starts, you have a number of options:

Synchronize all the data to each slave, and delete the databases and/or tables that you do not want to keep.

Use mysqldump to create a separate dump file for each database and load the appropriate dump file on each slave.

Use a raw data file dump and include only the specific files and databases that you need for each slave. This option will not work with InnoDB databases unless you use the innodb_file_per_table option.

Each slave in this configuration will transfer to the entire binary log from the master, but will only execute the events within the binary log that apply to the configured databases and tables.



阅读(662) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~