Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I have 3 servers, say A,B &C. All have the equivalent data(same data). Now what I want is to make A as the master and B,C the slaves.

But the scenario is that I only want to replicate some of the tables from a single database of the master (server A).

All the servers are running with the same data. So no need to take the dump from the master and restore on the Slaves.

Just to set the replication for some tables from a single database.

Is there any harm in doing this? And what step(s) should I follow to achieve this?

share|improve this question

2 Answers 2

up vote 2 down vote accepted

As Phil mentions, the replicate-do-table option is what you will want to accomplish your goal. Just throwing out a couple of caveats:

  1. The overhead might be punishing on high write loads. Take a look at the logic to determine if a row in the binary log should be executed on the slave.

  2. Supposedly the binlog format of the master (row or statement) doesn't affect table filtering rules. However, from what I understand (not tested) if you have any stored routines that affect the table, the replicate-do-table rule does not apply:

    This option affects only statements that apply to tables. It does not affect statements that apply only to other database objects, such as stored routines. To filter statements operating on stored routines, use one or more of the --replicate-*-db options.

    So if you are using any stored procedures to modify tables, you might run into some issues with the replication failing.

share|improve this answer
    
should i prefer replicate-do-table=db_name.table_name to be added on the slave..?will there be need to add replicate-do-db=db_name in the my.cnf as i am adding replicate-do-table=db_name.table_name.? –  Abdul Manaf Apr 23 '12 at 6:43

Setup a master<>slave configuration, then use the config parameter:

replicate-do-table=db_name.table_name

... to specify the tables that you wish to replicate. Either wildcard the table_name (if possible) or use multiple replicate-do-table= lines.

share|improve this answer
    
should i prefer replicate-do-table=db_name.table_name to be added on the slave..?will there be need to add replicate-do-db=db_name in the my.cnf as i am adding replicate-do-table=db_name.table_name.? –  Abdul Manaf Apr 23 '12 at 6:43

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.