Why MariaDB 11.4.1 master-slave replication not sync old data
I have a question about an issue I'm facing with MariaDB 11.4.1 (MariaDB 11 should have GTID enabled by default). I am trying to set up a highly available MariaDB (1 master with 2 slaves) using orchestrator. After shutting down the master database, orchestrator automatically switches one of the slave databases (u3) to become the new master (all slaves have log_slave_updates enabled). At this point, I manually create a brand new, empty slave database u2 (with no data) to synchronize with this new master. The Slave_IO_Running and Slave_SQL_Running status on u2 are both Yes. I attempt to create a new database on the master, and it appears on u2 as well. However, the problem is that the old databases present on u3 are not showing up on u2. ( see this image https://p.3ti.site/1712458958.webp ) I have searched online for solutions and it seems like I would need to manually back up the old databases, import them, and then modify the binlog files and synchronization positions. This feels cumbersome and is not convenient for automated recovery. I am wondering if there might be a misconfiguration on my part that is causing this issue.
"i18n.site--- via discuss" <discuss@lists.mariadb.org> writes:
At this point, I manually create a brand new, empty slave database u2 (with no data) to synchronize with this new master. The Slave_IO_Running and Slave_SQL_Running status on u2 are both Yes. I attempt to create a new database on the master, and it appears on u2 as well.
However, the problem is that the old databases present on u3 are not showing up on u2. ( see this image https://p.3ti.site/1712458958.webp )
I have searched online for solutions and it seems like I would need to manually back up the old databases, import them
Yes. MariaDB replication is a facility for asynchroneous replication of changes between servers, but it is not a cluster manager. Such managers are often built on top of replication. You can check if "orchestrator" has a facility to automatically provision a new slave for you. There is and old MDEV-7502 for automatic slave provisioning from within the server, but it is not currently being worked on, IIUC: https://jira.mariadb.org/browse/MDEV-7502
, and then modify the binlog files and synchronization positions.
This however is not necessary since you are using GTID. The GTID position can be used directly to start replication, without any manual modifications. For example back up the master like this: mysqldump --master-data --single-transaction --gtid ... Restoring this dump on the new slave will automatically set the GTID position ready for starting replication. - Kristian.
participants (2)
-
i18n.site@gmail.com
-
Kristian Nielsen