sincos
sincos

Reputation: 137

set up multi-source replication with mysql

I'm trying to setup the multi-source replication and I'm reading that tutorial : multi-source replication

I think I've found exactly what we are looking for! But I have a few questions, since this is my first time I’m trying to configure a MySQL replication.

We will have 2 (or more, will be added in the future, one by one) servers (masters) which will be installed on external IP (different customers office) and 1 “main server” (slave) installed on a “web server” (don’t know where for the moment).

  1. Is that possible to add a “master” once everything is setup for the other masters (and the slave) without restarting each server? In the future, multiple masters will probably be added.

  2. If we use the auto increment and that field is not my primary key, do I have to setup the part “auto_increment_increment”? This is because the number of masters will change over time.

  3. Do we absolutely need to use InnoDB for the tables to be able to replicate them in the multi-source replication? Or it is possible to use MyISAM?

  4. Is it possible to replicate only a few tables, I mean, ignore some tables? Do we have to use this : REPLICATE_IGNORE_TABLE ?

Upvotes: 0

Views: 802

Answers (1)

user7161651
user7161651

Reputation:

  1. Yes, you can use the below query on the slave to add a new master to your multi-source setup:

    CHANGE MASTER TO MASTER_HOST='master1', MASTER_USER='rpl', MASTER_PORT=3451, MASTER_PASSWORD='' \ MASTER_LOG_FILE='master1-bin.000006', MASTER_LOG_POS=628 FOR CHANNEL 'master-1’;

  2. auto_increment_increment is the amount that the server will increment each time an auto incremented value is generated. This variable is intended to be used with master-master replication, don’t think you can make much use of it in a multi-source replication setup.

  3. You can use MyISAM tables as well.
  4. If you want to replicate particular tables only then you can make use of the parameter “replicate_do_table=table_name” in your my.cnf file. For ignoring you can use the parameter “replicate_ignore_table” from your my.cnf file."

Upvotes: 2

Related Questions