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 |
| ... |
+--------------------------+---------------------+----------------------+---------------------+
-
Get an IAM token for API authentication and put it into the environment variable:
export IAM_TOKEN="<IAM_token>"
-
To get a list of cluster backups:
-
Use the Cluster.ListBackups method and make a request, e.g., via cURL
:curl \ --request GET \ --header "Authorization: Bearer $IAM_TOKEN" \ --url 'https://mdb.api.cloud.yandex.net/managed-greenplum/v1/clusters/<cluster_ID>/backups'
You can get the cluster ID with a list of clusters in the folder.
-
View the server response to make sure the request was successful.
-
-
To get a list of backups for all the clusters in a folder:
-
Use the Backup.List method and make a request, e.g., via cURL
:curl \ --request GET \ --header "Authorization: Bearer $IAM_TOKEN" \ --url 'https://mdb.api.cloud.yandex.net/managed-greenplum/v1/backups' \ --url-query folderId=<folder_ID>
You can request the folder ID with the list of folders in the cloud.
-
View the server response to make sure the request was successful.
-
-
Get an IAM token for API authentication and put it into the environment variable:
export IAM_TOKEN="<IAM_token>"
-
Clone the cloudapi
repository:cd ~/ && git clone --depth=1 https://github.com/yandex-cloud/cloudapi
Below, we assume the repository contents are stored in the
~/cloudapi/
directory. -
To get a list of cluster backups:
-
Use the ClusterService.ListBackups call and make a request, e.g., via gRPCurl
:grpcurl \ -format json \ -import-path ~/cloudapi/ \ -import-path ~/cloudapi/third_party/googleapis/ \ -proto ~/cloudapi/yandex/cloud/mdb/greenplum/v1/cluster_service.proto \ -rpc-header "Authorization: Bearer $IAM_TOKEN" \ -d '{ "cluster_id": "<cluster_ID>" }' \ mdb.api.cloud.yandex.net:443 \ yandex.cloud.mdb.greenplum.v1.ClusterService.ListBackups
You can get the cluster ID with a list of clusters in the folder.
-
View the server response to make sure the request was successful.
-
-
To get a list of backups for all the clusters in a folder:
-
Use the BackupService.List call and make a request, e.g., via gRPCurl
:grpcurl \ -format json \ -import-path ~/cloudapi/ \ -import-path ~/cloudapi/third_party/googleapis/ \ -proto ~/cloudapi/yandex/cloud/mdb/greenplum/v1/backup_service.proto \ -rpc-header "Authorization: Bearer $IAM_TOKEN" \ -d '{ "folder_id": "<folder_ID>" }' \ mdb.api.cloud.yandex.net:443 \ yandex.cloud.mdb.greenplum.v1.BackupService.List
You can request the folder ID with the list of folders in the cloud.
-
View the server response to make sure the request was successful.
-
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.
-
Get an IAM token for API authentication and put it into the environment variable:
export IAM_TOKEN="<IAM_token>"
-
Use the Backup.Get method and make a request, e.g., via cURL
:curl \ --request GET \ --header "Authorization: Bearer $IAM_TOKEN" \ --url 'https://mdb.api.cloud.yandex.net/managed-greenplum/v1/backups/<backup_ID>'
You can get the backup ID together with a list of backups.
-
View the server response to make sure the request was successful.
-
Get an IAM token for API authentication and put it into the environment variable:
export IAM_TOKEN="<IAM_token>"
-
Clone the cloudapi
repository:cd ~/ && git clone --depth=1 https://github.com/yandex-cloud/cloudapi
Below, we assume the repository contents are stored in the
~/cloudapi/
directory. -
Use the BackupService.Get call and make a request, e.g., via gRPCurl
:grpcurl \ -format json \ -import-path ~/cloudapi/ \ -import-path ~/cloudapi/third_party/googleapis/ \ -proto ~/cloudapi/yandex/cloud/mdb/greenplum/v1/backup_service.proto \ -rpc-header "Authorization: Bearer $IAM_TOKEN" \ -d '{ "backup_id": "<backup_ID>" }' \ mdb.api.cloud.yandex.net:443 \ yandex.cloud.mdb.greenplum.v1.BackupService.Get
You can get the backup ID together with a list of backups.
-
View the server response to make sure the request was successful.
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.
-
Get an IAM token for API authentication and put it into the environment variable:
export IAM_TOKEN="<IAM_token>"
-
Use the Cluster.Backup method and make a request, e.g., via cURL
:curl \ --request POST \ --header "Authorization: Bearer $IAM_TOKEN" \ --url 'https://mdb.api.cloud.yandex.net/managed-greenplum/v1/clusters/<cluster_ID>:backup'
You can get the cluster ID with a list of clusters in the folder.
-
View the server response to make sure the request was successful.
-
Get an IAM token for API authentication and put it into the environment variable:
export IAM_TOKEN="<IAM_token>"
-
Clone the cloudapi
repository:cd ~/ && git clone --depth=1 https://github.com/yandex-cloud/cloudapi
Below, we assume the repository contents are stored in the
~/cloudapi/
directory. -
Use the ClusterService.Backup call and make a request, e.g., via gRPCurl
:grpcurl \ -format json \ -import-path ~/cloudapi/ \ -import-path ~/cloudapi/third_party/googleapis/ \ -proto ~/cloudapi/yandex/cloud/mdb/greenplum/v1/cluster_service.proto \ -rpc-header "Authorization: Bearer $IAM_TOKEN" \ -d '{ "cluster_id": "<cluster_ID>" }' \ mdb.api.cloud.yandex.net:443 \ yandex.cloud.mdb.greenplum.v1.ClusterService.Backup
You can get the cluster ID with a list of clusters in the folder.
-
View the server response to make sure the request was successful.
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 creating 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.
-
-
Get an IAM token for API authentication and put it into the environment variable:
export IAM_TOKEN="<IAM_token>"
-
Create a file named
body.json
and add the following contents to it:{ "backupId": "<backup_ID>", "time": "<time>", "folderId": "<folder_ID>", "name": "<cluster_name>", "environment": "<environment>", "networkId": "<network_ID>", "config": { "zoneId": "<availability_zone>", "subnetId": "<subnet_ID>", "assignPublicIp": <public_access_to_cluster_hosts> }, "masterResources": { "resourcePresetId": "<host_class>", "diskSize": "<storage_size_in_bytes>", "diskTypeId": "<disk_type>" }, "segmentResources": { "resourcePresetId": "<host_class>", "diskSize": "<storage_size_in_bytes>", "diskTypeId": "<disk_type>" }, "segmentHostCount": "<number_of_segment_hosts>", "segmentInHost": "<number_of_segments_per_host>", "restoreOnly": [ "<DB_and_table_1>", "<DB_and_table_2>", ... "<DB_and_table_N>" ] }
Where:
-
backupId
: Backup ID. You can get it together with a list of backups. -
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. -
folderId
: ID of the folder you want to restore the cluster to. You can get the ID with a list of folders in the cloud. By default, the cluster is restored to the same folder where the backup is stored. -
name
: Name of the new cluster. -
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.
-
networkId
: Network ID. -
config
: Cluster settings:-
zoneId
: Availability zone. -
subnetId
: Subnet ID. -
assignPublicIp
: Public access to cluster hosts,true
orfalse
. -
masterResources
,segmentResources
: Master and segment host configuration in the cluster:resourcePresetId
: Host class.diskSize
: Disk size in bytes.diskTypeId
: Disk type.
-
segmentHostCount
: Number of segment hosts, from2
to32
. -
segmentInHost
: Number of segments per host. The maximum value of this parameter depends on the host class. -
restoreOnly
(optional): 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.
-
-
-
Use the Cluster.Restore method and make a request, e.g., via cURL
:curl \ --request POST \ --header "Authorization: Bearer $IAM_TOKEN" \ --header "Content-Type: application/json" \ --url 'https://mdb.api.cloud.yandex.net/managed-greenplum/v1/clusters:restore' \ --data "@body.json"
-
View the server response to make sure the request was successful.
-
Get an IAM token for API authentication and put it into the environment variable:
export IAM_TOKEN="<IAM_token>"
-
Clone the cloudapi
repository:cd ~/ && git clone --depth=1 https://github.com/yandex-cloud/cloudapi
Below, we assume the repository contents are stored in the
~/cloudapi/
directory. -
Create a file named
body.json
and add the following contents to it:{ "backup_id": "<backup_ID>", "time": "<time>", "folder_id": "<folder_ID>", "name": "<cluster_name>", "environment": "<environment>", "network_id": "<network_ID>", "config": { "zone_id": "<availability_zone>", "subnet_id": "<subnet_ID>", "assign_public_ip": <public_access_to_cluster_hosts> }, "master_resources": { "resource_preset_id": "<host_class>", "disk_size": "<storage_size_in_bytes>", "disk_type_id": "<disk_type>" }, "segment_resources": { "resource_preset_id": "<host_class>", "disk_size": "<storage_size_in_bytes>", "disk_type_id": "<disk_type>" }, "segment_host_count": "<number_of_segment_hosts>", "segment_in_host": "<number_of_segments_per_host>", "restore_only": [ "<DB_and_table_1>", "<DB_and_table_2>", ... "<DB_and_table_N>" ] }
Where:
-
backup_id
: Backup ID. You can get it together with a list of backups. -
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. -
folder_id
: ID of the folder you want to restore the cluster to. You can get the ID with a list of folders in the cloud. By default, the cluster is restored to the same folder where the backup is stored. -
name
: Name of the new cluster. -
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_id
: Network ID. -
config
: Cluster settings:-
zone_id
: Availability zone. -
subnet_id
: Subnet ID. -
assign_public_ip
: Public access to cluster hosts,true
orfalse
. -
master_resources
,segment_resources
: Master and segment host configuration in the cluster:resource_preset_id
: Host class.disk_size
: Disk size in bytes.disk_type_id
: Disk type.
-
segment_host_count
: Number of segment hosts, from2
to32
. -
segment_in_host
: Number of segments per host. The maximum value of this parameter depends on the host class. -
restore_only
(optional): 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.
-
-
-
Use the ClusterService.Restore call and make a request, e.g., via gRPCurl
:grpcurl \ -format json \ -import-path ~/cloudapi/ \ -import-path ~/cloudapi/third_party/googleapis/ \ -proto ~/cloudapi/yandex/cloud/mdb/greenplum/v1/cluster_service.proto \ -rpc-header "Authorization: Bearer $IAM_TOKEN" \ -d @ \ mdb.api.cloud.yandex.net:443 \ yandex.cloud.mdb.greenplum.v1.ClusterService.Restore \ < body.json
-
View the server response to make sure the request was successful.
Greenplum® and Greenplum Database® are registered trademarks or trademarks of VMware, Inc. in the United States and/or other countries.