Replication in Managed Service for MySQL
Managed Service for MySQL clusters use semi-sync replication
Note
You can change the number of replicas required for a transaction to complete in the Rpl semi sync master wait for slave count setting.
Managing replication procedures
Recommended cluster configuration
Once you create a MySQL cluster with multiple hosts, it contains one master host and replicas. Replicas use the master host as a replication source.
Specifics of automatic replication in Managed Service for MySQL:
- If the master host fails, its replica becomes a new master.
- When the master changes, the replication source for all replica hosts automatically switches to the new master host.
For more information, see Selecting a master if the primary master fails.
Selecting a master if the primary master fails
If the master host fails, any of the cluster hosts available for replication becomes a new master. To affect master selection in a MySQL cluster, set the required priority values for the cluster hosts. The host with the highest priority will become master; in a cluster with multiple replicas of equal priority, the replica with the lowest lag with respect to the master will be selected. Replicas lagging more than the value of the Mdb priority choice max lag setting (60 seconds, by default) will be excluded from the selection.
You can set the priority for a host:
- When creating a cluster using Nebius AI interfaces other than the management console.
- When changing the host settings.
The lowest priority is 0
(default), while the highest one is 100
.