Managing backups in Managed Service for Greenplum®
You can view your existing backups and restore clusters from them.
Getting a list of backups
To get a list of cluster backups:
- Go to the folder page
and select Managed Service for Greenplum. - Click the name of the cluster you need and select the
Backups tab.
To get a list of all backups in a folder:
- Go to the folder page
and select Managed Service for Greenplum. - In the left-hand panel, select
Backups.
If you do not have the Yandex Cloud command line interface yet, install and initialize it.
The folder specified in the CLI profile is used by default. You can specify a different folder using the --folder-name
or --folder-id
parameter.
To get a list of Greenplum® cluster backups, run the command:
yc managed-greenplum cluster list-backups <cluster_name_or_ID>
You can get the cluster ID and name with a list of clusters in the folder.
Result:
+--------------------------+---------------------+----------------------+---------------------+
| ID | CREATED AT | SOURCE CLUSTER ID | STARTED AT |
+--------------------------+---------------------+----------------------+---------------------+
| c9qgo11pud7k********:... | 2020-08-10 12:00:00 | c9qgo11pud7k******** | 2020-08-10 11:55:17 |
| ... |
+--------------------------+---------------------+----------------------+---------------------+
To get a list of cluster backups, use the listBackups REST API method for the Cluster resource or the ClusterService/ListBackups gRPC API call and provide the cluster ID in the clusterId
parameter of your request.
To get a list of backups for all the Managed Service for Greenplum® clusters in the folder, use the list REST API method for the Backup resource or the BackupService/List gRPC API call and provide the folder ID in the folderId
parameter of your request.
You can get the cluster ID with a list of clusters in the folder.
Getting information about backups
To get information about the backup of an existing cluster:
- Go to the folder page
and select Managed Service for Greenplum. - Click the name of the cluster you need and select the
Backups tab.
To get information about the backup of a previously deleted cluster:
- Go to the folder page
and select Managed Service for Greenplum. - In the left-hand panel, select
Backups.
To get information about a backup, use the get REST API method for the Backup resource or the BackupService/Get gRPC API call and provide the backup ID in the backupId
parameter of your request.
To find out the ID, retrieve a list of backups.
Creating a backup
- Go to the folder page and select Managed Service for Greenplum.
- Click the name of the cluster you need and select the
Backups tab. - Click
Create backup.
The service will start creating a backup without an additional confirmation.
Warning
While you are creating your backup, the cluster performance might degrade.
Restoring clusters from backups
The Point-in-Time Recovery (PITR) technology enables you to restore cluster state to any recovery point created after saving a backup. For more information, see Backups.
When you restore a cluster from a backup, you create a new cluster with the backup data. If the folder has insufficient resources to create such a cluster, you will not be able to restore from the backup.
For a new cluster, you should set all the parameters that are required at creation.
To migrate Managed Service for Greenplum® cluster hosts to a different availability zone, restore your cluster from a backup. You may need to do this, for example, if your cluster hosts reside in the ru-central1-c
zone which is to be deprecated. During cluster recovery from a backup, specify a new availability zone. If your cluster operates as a Yandex Data Transfer endpoint, familiarize yourself with the migration process in Data Transfer before recovering from a backup.
Warning
Recovering from a backup imposes restrictions on parameters of the new cluster.
- The total number of segments must be the same as in the source cluster.
- The disk size per segment in the new cluster must be at least as large as in the source cluster.
Example
The source cluster has four segment hosts, each containing four segments. The total number of segments is 16. When restoring the cluster, you can choose two segment hosts with eight segments per host, so that the total number of segments remains 16.
To ensure that the disk size per segment does not decrease, the disk size in each segment host must at least double.
If you set the current time as the recovery time, the new cluster will match the state of the latest available recovery point.
To restore an existing cluster from a backup:
-
Go to the folder page
and select Managed Service for Greenplum. -
Click the name of the cluster you need and select the
Backups tab. -
Click
for the backup you need and click Restore cluster. -
Set up the new cluster. You can select a folder for the new cluster from the Folder list.
-
In the Date and time of recovery (UTC) setting, specify the time point to which you want to restore the cluster. You can enter a value manually or select it from the drop-down calendar. The service will select the recovery point closest to that time.
If you do not change the setting, the cluster state will be copied from a backup. Recovery points will not be used.
-
If you want to restore only certain databases or tables, list them in the Databases and tables for recovery field. If you leave the field blank, the whole cluster will be restored.
-
In the Host count setting, specify the number of segment hosts.
-
In the Segments per host setting, specify the number of segments per host.
-
Click Create.
To restore a previously deleted cluster from a backup:
-
Go to the folder page
and select Managed Service for Greenplum. -
In the left-hand panel, select
Backups. -
Find the backup you need using the backup creation time and cluster ID. The ID column contains IDs formatted as
<cluster_ID>:<backup_ID>
. -
Click
for the backup you need and click Restore cluster. -
Set up the new cluster. You can select a folder for the new cluster from the Folder list.
-
In the Date and time of recovery (UTC) setting, specify the time point to which you want to restore the cluster. You can enter a value manually or select it from the drop-down calendar. The service will select the recovery point closest to that time.
If you do not change the setting, the cluster state will be copied from a backup. Recovery points will not be used.
-
If you want to restore only certain databases or tables, list them in the Databases and tables for recovery field. If you leave the field blank, the whole cluster will be restored.
-
In the Host count setting, specify the number of segment hosts.
-
In the Segments per host setting, specify the number of segments per host.
-
Click Create.
Managed Service for Greenplum® will launch the operation to create a cluster from the backup.
If you do not have the Yandex Cloud command line interface yet, install and initialize it.
The folder specified in the CLI profile is used by default. You can specify a different folder using the --folder-name
or --folder-id
parameter.
To restore a cluster from a backup:
-
View a description of the CLI restore Greenplum® cluster command:
yc managed-greenplum cluster restore --help
-
Request the creation of a cluster from a backup:
yc managed-greenplum cluster restore \ --backup-id=<backup_ID> \ --time=<time_point> \ --name=<cluster_name> \ --environment=<environment> \ --network-name=default \ --master-resource-preset=<host_class> \ --master-disk-size=<storage_size_in_GB> \ --master-disk-type=<disk_type> \ --segment-resource-preset=<host_class> \ --segment-disk-size=<storage_size_in_GB> \ --segment-disk-type=<disk_type> \ --segment-host-count <number_of_segment_hosts> \ --segment-in-host <number_of_segments_per_host> \ --restore-only=<list_of_DBs_and_tables_to_restore> \ --zone-id=<availability_zone> \ --subnet-id=<subnet_ID> \ --assign-public-ip=<public_access_to_cluster>
Where:
-
--backup-id
: Backup ID. -
--time
: Time point to restore the Greenplum® cluster to, inyyyy-mm-ddThh:mm:ssZ
time format. By default, the cluster will be restored from a backup. -
--name
: Cluster name. -
--environment
: Environment:PRESTABLE
: For testing purposes. The prestable environment is similar to the production environment and likewise covered by the SLA, but it is the first to get new functionalities, improvements, and bug fixes. In the prestable environment, you can test compatibility of new versions with your application.PRODUCTION
: For stable versions of your apps.
-
--network-name
: Network name. -
--master-resource-preset
: Master host class. -
--master-disk-size
: Size of master host storage in GB. -
--master-disk-type
: Master host disk type. -
--segment-resource-preset
: Segment host class. -
--segment-disk-size
: Size of segment host storage in GB. -
--segment-disk-type
: Segment host disk type. -
--segment-host-count
: Number of segment hosts. -
--segment-in-host
: Number of segments per host. -
--restore-only
(optional): Comma-separated list of DBs and tables to restore from the backup. Supported formats:<DB>/<schema>/<table>
,<DB>/<table>
, and<DB>
. You may use the*
wildcard symbol as well. If you omit this parameter, the whole cluster will be restored. -
--zone-id
: Availability zone. -
--subnet-id
: Subnet ID. Specify if two or more subnets are created in the selected availability zone. -
--assign-public-ip
: Flag you set if the cluster needs access from the internet.
-
To restore a cluster from a backup, use the restore REST API method for the Cluster resource or the ClusterService/Restore gRPC API call and provide the following in the request:
- ID of the backup you need, in the
backupId
parameter. To find out the ID, get a list of cluster backups. - Time point to which you want to restore the cluster, in the
time
parameter. By default, the cluster will be restored from a backup. - Number of segment hosts in the
segmentHostCount
parameter. - Number of segments per host in the
segmentInHost
parameter. - Name of the new cluster that will contain the data recovered from the backup, in the
name
parameter. It must be unique within the folder. - (Optional) Comma-separated list of DBs and tables to restore from the backup, in the
restoreOnly
parameter. Supported formats:<DB>/<schema>/<table>
,<DB>/<table>
, and<DB>
. You may use the*
wildcard symbol as well. If you omit this parameter, the whole cluster will be restored.
By default, the cluster is restored to the same folder where the backup is stored. To restore the cluster to a different folder, specify its ID in the folderId
parameter.
Warning
While you are creating your backup, the cluster performance might degrade.
Greenplum® and Greenplum Database® are registered trademarks or trademarks of VMware, Inc. in the United States and/or other countries.