High availability of a Managed Service for MySQL® cluster
High availability of a Managed Service for MySQL® cluster depends on the number and placement of its hosts, replication settings, and other cluster parameters.
Number and placement of cluster hosts
A cluster may consist of one or more hosts.
A single-host cluster does not provide high availability. If the master host VM fails, your cluster will be unavailable for reading and writing until the VM recovers completely. Single-host clusters are not covered by the Service level agreement (SLA)
Warning
We do not recommend creating a single-host cluster.
A cluster with two hosts located in different availability zones is considered highly available and is subject to the SLA
A cluster with three or more hosts located in three different availability zones is considered highly available and is subject to the SLA
Note
A host with a manually set replication source is not counted into the minimum number of hosts required to ensure the high availability of a cluster.
Replication and master failover settings
High availability is achieved through replication and master failover, which work as follows:
- Clusters use a mechanism for automatic selection and failover to a new master. If the master host fails, one of its replicas becomes a new master. You can also select a new master and switch to it manually.
- For any replica, you can manually select a host as the replication source. Such a replica will not be involved in the master selection and failover mechanism.
- If you use public access for the host, you must also enable it for the replicas, otherwise the cluster will become unavailable following master failover.
- Using the current master's FQDN simplifies application development; however, your cluster will be temporarily unavailable while switching to a new master. To quickly switch to a new master, you need to implement the new master definition on the application side.
- Managed Service for MySQL® clusters use semi-sync replication
: by default, the master waits for a transaction to be completed in at least one replica. You can increase the minimum number of replicas that must confirm a transaction using the MySQL® Rpl semi sync master wait for slave count setting. We recommend to set Rpl semi sync master wait for slave count to at least the maximum number of hosts per zone, not including hosts with a manually selected replication source.
Storage settings
If database storage is 95% full, the cluster will switch to read-only mode. To keep the cluster writable, we recommend to regularly check free storage space or create an alert.
Maintenance settings
During cluster maintenance and MySQL® version updates, read performance may temporarily drop and the cluster may become temporarily unavailable for writing. Therefore, we recommend selecting suitable maintenance day and hour, as well as MySQL® version update time, based on expected cluster load.
Other settings
The following settings may also affect cluster availability:
- Backup settings.
- Storage disk type you selected.
- Host classes.
- Quotas and limits.
- Configuring security groups.
- MySQL® Max connections and Sync binlog settings.