0

I have 2 Raspberry PI's and each run a MariaDB 10.3 server. Each has the same databases:

  • vennens
  • scheduler

On the slave I've configured the 50-server.conf file with follow contents:

master_pi1.replicate_do_db=scheduler_pi1

master_pi1.replicate_do_db=vennens_pi1

master_pi2.replicate_do_db=scheduler_pi2

master_pi2.replicate_do_db=vennens_pi2

master_pi1.replicate_rewrite_db=scheduler->scheduler_pi1
master_pi1.replicate_rewrite_db=vennens->vennens_pi1
master_pi2.replicate_rewrite_db=scheduler->scheduler_pi2
master_pi2.replicate_rewrite_db=vennens->vennens_pi2

Then I have run the CHANGE MASTER queries with the correct information. When I update data on the PI's, they are not synced with the slave. I see an error when I ask for statuses.

error example

I've removed the replicate_rewrite_db and did the process all over again for replication but now each has Raspberry PI has an unique database name. And this setup works. There is nothing wrong with the connection.

I also see in the relay log of each connection that queries are received.

On the server I run MariaDB 10.5

What could be the issue here?

I've read:

1 Answer 1

2

Replication maintains synchronization of the data. It does not initialize the Repicas.

That is, you must first copy the data from the Primaries to the Replica, then establish the "multi-source" replication.

If writes (to the Primaries) are happening during the setup, it gets tricky to avoid losing them.

1
  • I've done that with mysqldump on the master and changed the database name in de dump to the database name for the slave 'vennens' (master) -> 'vennens_pi1' (slave) Then I imported these to the slave server. Then changed the configuration and restarted the mariadb service. The tables where locked on the master to get he position. Dec 29, 2021 at 10:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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