Restoring database clusters in case of an availability zone failure
This section offers practical advice on how to restore data if Yandex Cloud zones are unavailable
Basic recommendations for different failures
If one of the availability zones is unavailable, the process depends on the host location and cluster state. In the examples below, the ru-central1-b is assumed to be unavailable. Select the appropriate use case:
- All cluster hosts are in the unavailable zone.
- Some hosts are in the available zone; the master switched.
- Some hosts are in the available zone; the master did not switch, and the cluster is read-only.
- The cluster does not have hosts in the unavailable zone.
All cluster hosts are in the unavailable zone
To reduce the downtime, do not wait for the availability zone to become available again and start restoring from a backup.
- Check the available cluster’s backups and choose the restore point. Recovery to a certain time period depends on the service and backup type.
- Restore your cluster from a backup using your service’s guide. When configuring the new cluster, locate its hosts in different availability zones.
- Wait until the recovery is complete, check the data, and configure your application connection to the new cluster.
Warning
Data missing for the selected restore point will be missing in the new cluster. If you do not have an appropriate backup or recovery fails, contact support
Guide on restoring from a backup:
|
Service |
Guide |
|
Managed Service for PostgreSQL |
|
|
Managed Service for MySQL® |
|
|
Managed Service for ClickHouse® |
|
|
Yandex Managed Service for Valkey™ |
|
|
Yandex StoreDoc |
|
|
Managed Service for OpenSearch |
|
|
Yandex MPP Analytics for PostgreSQL |
|
|
Managed Service for Sharded PostgreSQL |
A Managed Service for Sharded PostgreSQL backup contains shard configuration. Restore the shard data separately in Managed Service for PostgreSQL if needed.
Some hosts are in the available zone; the master switched
This use case is suitable for a multi-host cluster if a master switched to a host in a different availability zone.
- Make sure your application connects to the new master and can write data.
- If adding hosts is not available, add hosts to a different zones to replace the unavailable ones. If you cannot add hosts, contact support
. - What until the new hosts sync data and will be able to operate. Then delete the hosts in the
ru-central1-bzone considering the service limit on the minimum number of hosts. If deletion is temporarily unavailable, try again later.
Guides on managing hosts:
|
Service |
Adding a host |
Deleting a host |
|
Managed Service for PostgreSQL |
||
|
Managed Service for MySQL® |
||
|
Yandex Managed Service for Valkey™ |
||
|
Yandex StoreDoc |
Master did not switch, and the cluster is read-only
This use case is suitable for a multi-host cluster with some hosts in the ru-central1-b zone, if a master did not switch, and the cluster switched to read-only (RO).
Automatic master switch may not occur because of the risk of data loss. In this use case, you cannot switch the master manually.
- Contact support
. Specify the cluster ID and describe its state. - Wait for the support team to switch your master.
- Perform the actions described in the use case where the master switched.
The cluster does not have hosts in the unavailable zone
To prepare for possible failures of other availability zones:
- Check the cluster’s and application’s configuration using these recommendations on fault tolerance. Consider your service requirements to the host location and number.
- If you need to set up data transfer and replication, check these Data Transfer guides and requirements on preparing the source and target.
Data migration from managed database backups to third-party clusters
If Yandex Cloud managed database backups are stored in Object Storage with replication across three zones, your data is preserved.
To save a copy of your data, you can upload managed database hosts in available zones as per the guides below:
|
Service |
Guide |
|
Managed Service for PostgreSQL |
|
|
Managed Service for MySQL® |
|
|
Yandex StoreDoc |
|
|
Yandex Managed Service for Valkey™ |
|
|
Managed Service for ClickHouse® |
|
|
Managed Service for OpenSearch |
|
|
Managed Service for Apache Kafka® |
No automatic backups are provided |
|
Yandex MPP Analytics for PostgreSQL |
Use |
Data migration from managed database services to a third-party cluster using replication
If you have an available Yandex Cloud host, you can copy its data to a self-hosted database instance using replication:
|
Service |
Guide |
|
Managed Service for PostgreSQL |
|
|
Managed Service for MySQL® |
Migrating a database from Yandex Cloud to a third-party cluster |
|
Yandex Managed Service for Valkey™ |
Data migration from managed database services to a Selectel cluster using Managed Service for Trino
There is a method available for data migration to Selectel infrastructure using Managed Service for Trino:
|
Service |
Guide |
|
Managed Service for PostgreSQL |
Migrating data from PostgreSQL to a PostgreSQL cloud database using Trino |
|
Managed Service for MySQL® |
Migrating data from MySQL® to a MySQL® cloud database using Trino |
|
Managed Service for ClickHouse® |
Migrating data from ClickHouse® to a ClickHouse® cloud database using Trino |