Replicating Different Databases to Different Slaves
1491
to help spread the load during data analysis. A sample of this layout is shown in
Figure 16.2, “Using
Replication to Replicate Databases to Separate Replication Slaves”
.
Figure 16.2. Using Replication to Replicate Databases to Separate Replication Slaves
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
[1459]
configuration option on each slave.
Important
You should not use
--replicate-do-db
[1457]
for this purpose, since its
affects vary according to the database that is currently selected.
For example, to support the separation as shown in
Figure 16.2, “Using Replication to Replicate
Databases to Separate Replication Slaves”
, you should configure each replication slave as follows,
before executing
START SLAVE
:
• Replication slave 1 should use
--replicate-wild-do-table=databaseA.%
.
• Replication slave 2 should use
--replicate-wild-do-table=databaseB.%
.
• Replication slave 3 should use
--replicate-wild-do-table=databaseC.%
.
Each slave in this configuration receives the entire binary log from the master, but executes only those
events from the binary log that apply to the databases and tables included by the
--replicate-
wild-do-table
[1459]
option in effect on that slave.
If you have data that must be synchronized to the slaves before replication starts, you have a number
of choices:
• Synchronize all the data to each slave, and delete the databases, tables, or both 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.
Note
This does not work with
InnoDB
databases unless you use
innodb_file_per_table
[1241]
.
Summary of Contents for 5.0
Page 1: ...MySQL 5 0 Reference Manual ...
Page 18: ...xviii ...
Page 60: ...40 ...
Page 396: ...376 ...
Page 578: ...558 ...
Page 636: ...616 ...
Page 844: ...824 ...
Page 1234: ...1214 ...
Page 1427: ...MySQL Proxy Scripting 1407 ...
Page 1734: ...1714 ...
Page 1752: ...1732 ...
Page 1783: ...Configuring Connector ODBC 1763 ...
Page 1793: ...Connector ODBC Examples 1773 ...
Page 1839: ...Connector Net Installation 1819 2 You must choose the type of installation to perform ...
Page 2850: ...2830 ...
Page 2854: ...2834 ...
Page 2928: ...2908 ...
Page 3000: ...2980 ...
Page 3122: ...3102 ...
Page 3126: ...3106 ...
Page 3174: ...3154 ...
Page 3232: ...3212 ...