Scaling a Database Cluster
Managed Databases service allows you to increase or decrease the number of replicas in the cluster, as well as change the server configuration to provide better performance of the database cluster.
Changing the Configuration of Servers in a Cluster
You can only change the configuration of the database servers upwards due to the limits on the disk space.
Follow these steps to change the configuration of the cluster servers:
- Go to the cluster settings page.
- Click Scale cluster.
- Select the required configuration.
- Save your changes.
- The cluster’s status will change to RESIZING. The time that the cluster will remain in this status depends on the amount of data in the cluster.
- Scaling process will vary depending on the number of replicas in the cluster.
- If there are no replicas in the cluster (the cluster consists only of the master), then the master will be stopped to apply the changes. Because of this, the cluster will be temporarily unavailable for read and write. After applying the changes, the master will start and the cluster will be available again.
If there are replicas in the cluster, scaling process will not affect its operation — the cluster will be available for read and write while applying changes. For a cluster with replicas, the configuration change will look as follows:
- first, the replicas will be stopped one by one, and their configurations will be changed;
- after all replicas are scaled, the master will switch to a synchronous replica;
- lastly, the “former master” will be scaled.
In both cases, after successfully applying the changes, the cluster’s status will change to ACTIVE.
Changing the Number of Replicas
The presence of replicas in a cluster affects its fault tolerance. We recommend creating fault-tolerant clusters consisting of the master and replicas.
Follow these steps to change the number of replicas in a cluster:
- Click Scale cluster on the cluster settings page.
Select the required number of replicas.
Please note that each new replica takes a new address in the subnet. You cannot add replicas to the cluster if there are no free addresses on the subnet that the cluster is connected to.
Save your changes.
The cluster’s status will change to RESIZING. The cluster still will be available in this status.
After the operation is completed, the cluster’s status will change to ACTIVE.