This is a read-only copy of the MariaDB Knowledgebase generated on 2024-11-15. For the latest, interactive version please visit https://mariadb.com/kb/.

Multi Master Replication

Greetings, I am attempting to set up Multi Master Replication. So far, I have been able to set up multiple masters and data is replicated to one slave. This works great.

What I am having a problem with is if I add a new master. When I add the master the data in the slave table is truncated and only the data from the new master is replicated. I loose all my old data in the slave.

Example:

Master 1300:

+----------------+

name

+----------------+

t1300

Master 13:

+----------------+

name

+----------------+

t13

+----------------+

Slave:

+----------------+

name

+----------------+

t1300

t13

+----------------+

On the slave I do this: change master 't68' to master_host='10.79.84.149', master_user='replication_user', master_port=3306;

start slave t1300;

select * from name;

Slave:

+----------------+

name

+----------------+

t68

+----------------+

Answer Answered by Daniel Black in this comment.

Don't have the slave replicating from the master that you are loading. Configure replication after it is loaded.

Alternately use a session sql_log_bin=0 when loading data into the new master so that the drop database/tables statements aren't replicated to the slave.

Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.