Updating a Greenplum® cluster configuration
After creating a cluster, you can:
- Change the host class.
- Change the disk type and increase the storage size.
- Expand the cluster by adding segment hosts or increasing the number of segments per hosts.
- Change the cluster's availability zone.
Changing the host class
You can change the host class for both master hosts and segment hosts. When changing the host class, the cluster's primary master host will change.
Warning
When changing the host class:
- Cluster hosts will not be available.
- User sessions will be terminated.
- Using a special FQDN does not guarantee a stable database connection.
When changing the class of segment hosts, make sure that the new amount of memory in segment hosts is sufficient to maintain the number of connections specified in the Max connections setting.
We recommend changing the host class only when the cluster has no active workload.
Make sure your cloud has enough quotas to change the host class. Open the cloud's Quotas
- Navigate to the folder dashboard and select Managed Service for Greenplum.
- Select a cluster and click
Edit in the top panel. - Under Host class, select the required class for Greenplum® master hosts or segment hosts.
- Click Save changes.
If you do not have the Yandex Cloud (CLI) command line interface yet, install and initialize it.
The folder specified when creating the CLI profile is used by default. To change the default folder, use the yc config set folder-id <folder_ID>
command. You can specify a different folder using the --folder-name
or --folder-id
parameter.
To change the host class for the cluster:
-
View the description of the CLI command to update the cluster:
yc managed-greenplum cluster update --help
-
Request a list of available classes (the
ZONE IDS
column lists the availability zones where you can select the appropriate class):-
For master hosts:
yc managed-greenplum resource-preset list master
-
For segment hosts:
yc managed-greenplum resource-preset list segment
+-------------+--------------------------------+--------------------------------+-------+----------+--------------------+---------------------+ | ID | ZONE IDS | DISK TYPES | CORES | MEMORY | HOST COUNT DIVIDER | MAX SEGMENT IN HOST | +-------------+--------------------------------+--------------------------------+-------+----------+--------------------+---------------------+ | i2.2xlarge | ru-central1-a, ru-central1-b | local-ssd, | 16 | 128.0 GB | 1 | 0 | | | | network-ssd-nonreplicated | | | | | | ... | +-------------+--------------------------------+--------------------------------+-------+----------+--------------------+---------------------+
-
-
Specify the required classes in the cluster update command:
yc managed-greenplum cluster update <cluster_name_or_ID> \ --master-config resource-id=<master_host_class_ID> \ --segment-config resource-id=<segment_host_class_ID>
Managed Service for Greenplum® will run the update host class command for the cluster.
-
Open the current Terraform configuration file that defines your infrastructure.
For more information about creating this file, see Creating clusters.
For a complete list of available Managed Service for Greenplum® cluster configuration fields, see the Terraform provider documentation
. -
In the Managed Service for Greenplum® cluster description, change the
resource_preset_id
attribute value undermaster_subcluster.resources
orsegment_subcluster.resources
:resource "yandex_mdb_greenplum_cluster" "<cluster_name>" { ... master_subcluster { resources { resource_preset_id = "<host_class>" ... } } segment_subcluster { resources { resource_preset_id = "<host_class>" ... } } }
-
Make sure the settings are correct.
-
In the command line, navigate to the directory that contains the current Terraform configuration files defining the infrastructure.
-
Run this command:
terraform validate
Terraform will show any errors found in your configuration files.
-
-
Confirm updating the resources.
-
Run this command to view the planned changes:
terraform plan
If you described the configuration correctly, the terminal will display a list of the resources to update and their parameters. This is a verification step that does not apply changes to your resources.
-
If everything looks correct, apply the changes:
-
Run this command:
terraform apply
-
Confirm updating the resources.
-
Wait for the operation to complete.
-
Warning
The Terraform provider limits the amount of time for all Managed Service for Greenplum® cluster operations to complete to 120 minutes.
Operations exceeding the set timeout are interrupted.
How do I change these limits?
Add the
timeouts
block to the cluster description, for example:resource "yandex_mdb_greenplum_cluster" "<cluster name>" { ... timeouts { create = "1h30m" # 1 hour 30 minutes update = "2h" # 2 hours delete = "30m" # 30 minutes } }
-
-
Get an IAM token for API authentication and put it into the environment variable:
export IAM_TOKEN="<IAM_token>"
-
Use the Cluster.Update method and send the following request, e.g., via cURL
:Warning
The API method will assign default values to all the parameters of the object you are modifying unless you explicitly provide them in your request. To avoid this, list the settings you want to change in the
updateMask
parameter as a single comma-separated string.curl \ --request PATCH \ --header "Authorization: Bearer $IAM_TOKEN" \ --header "Content-Type: application/json" \ --url 'https://mdb.api.cloud.yandex.net/managed-greenplum/v1/clusters/<cluster_ID>' \ --data '{ "updateMask": "masterConfig.resources.resourcePresetId,segmentConfig.resources.resourcePresetId", "masterConfig": { "resources": { "resourcePresetId": "<host_class>" } }, "segmentConfig": { "resources": { "resourcePresetId": "<host_class>" } } }'
Where:
-
updateMask
: List of parameters to update as a single string, separated by commas. -
masterConfig.resources.resourcePresetId
andsegmentConfig.resources.resourcePresetId
: New host class for master and segment hosts.
You can request the cluster ID with the 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.Update call and send the following request, e.g., via gRPCurl
:Warning
The API method will assign default values to all the parameters of the object you are modifying unless you explicitly provide them in your request. To avoid this, list the settings you want to change in the
update_mask
parameter as an array ofpaths[]
strings.Format for listing settings
"update_mask": { "paths": [ "<setting_1>", "<setting_2>", ... "<setting_N>" ] }
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>", "update_mask": { "paths": [ "master_config.resources.resource_preset_id", "segment_config.resources.resource_preset_id" ] }, "master_config": { "resources": { "resource_preset_id": "<host_class>" } }, "segment_config": { "resources": { "resource_preset_id": "<host_class>" } } }' \ mdb.api.cloud.yandex.net:443 \ yandex.cloud.mdb.greenplum.v1.ClusterService.Update
Where:
-
update_mask
: List of parameters to update as an array ofpaths[]
strings. -
master_config.resources.resource_preset_id
andsegment_config.resources.resource_preset_id
: New host class for master and segment hosts.
You can request the cluster ID with the list of clusters in the folder.
-
-
View the server response to make sure the request was successful.
Change the disk type and increase the storage size
Make sure the cloud has enough quota to increase the storage size. Open the cloud's Quotas
Warning
When changing disk type and increasing storage size:
- Cluster hosts will not be available.
- User sessions will be terminated.
- Using a special FQDN does not guarantee a stable database connection.
-
In the management console
, select the folder with the cluster you need. -
Select Managed Service for Greenplum.
-
Select the cluster.
-
At the top of the page, click Edit.
-
Under Storage:
- Select the disk type.
- Specify the required disk size.
-
Click Save.
If you do not have the Yandex Cloud (CLI) command line interface yet, install and initialize it.
The folder specified when creating the CLI profile is used by default. To change the default folder, use the yc config set folder-id <folder_ID>
command. You can specify a different folder using the --folder-name
or --folder-id
parameter.
To increase the cluster storage size:
-
View the description of the CLI command to update the cluster:
yc managed-greenplum cluster update --help
-
Specify the required storage size for the master hosts or segment hosts in the cluster update command (at least as large as
disk_size
in the cluster properties):yc managed-mysql cluster update <cluster_name_or_ID> \ --master-config disk-size <storage_size_in_GB> \ --segment-config disk-size <storage_size_in_GB>
-
Open the current Terraform configuration file that defines your infrastructure.
For more information about creating this file, see Creating clusters.
For a complete list of available Managed Service for Greenplum® cluster configuration fields, see the Terraform provider documentation
. -
In the Managed Service for Greenplum® cluster description, change the values of the
disk_type_id
anddisk_size
attributes undermaster_subcluster.resources
orsegment_subcluster.resources
:resource "yandex_mdb_greenplum_cluster" "<cluster_name>" { ... master_subcluster { resources { disk_type_id = "<disk_type>" disk_size = <storage_size_in_GB> ... } } segment_subcluster { resources { disk_type_id = "<disk_type>" disk_size = <storage_size_in_GB> ... } } }
-
Make sure the settings are correct.
-
In the command line, navigate to the directory that contains the current Terraform configuration files defining the infrastructure.
-
Run this command:
terraform validate
Terraform will show any errors found in your configuration files.
-
-
Confirm updating the resources.
-
Run this command to view the planned changes:
terraform plan
If you described the configuration correctly, the terminal will display a list of the resources to update and their parameters. This is a verification step that does not apply changes to your resources.
-
If everything looks correct, apply the changes:
-
Run this command:
terraform apply
-
Confirm updating the resources.
-
Wait for the operation to complete.
-
Warning
The Terraform provider limits the amount of time for all Managed Service for Greenplum® cluster operations to complete to 120 minutes.
Operations exceeding the set timeout are interrupted.
How do I change these limits?
Add the
timeouts
block to the cluster description, for example:resource "yandex_mdb_greenplum_cluster" "<cluster name>" { ... timeouts { create = "1h30m" # 1 hour 30 minutes update = "2h" # 2 hours delete = "30m" # 30 minutes } }
-
-
Get an IAM token for API authentication and put it into the environment variable:
export IAM_TOKEN="<IAM_token>"
-
Use the Cluster.Update method and send the following request, e.g., via cURL
:Warning
The API method will assign default values to all the parameters of the object you are modifying unless you explicitly provide them in your request. To avoid this, list the settings you want to change in the
updateMask
parameter as a single comma-separated string.curl \ --request PATCH \ --header "Authorization: Bearer $IAM_TOKEN" \ --header "Content-Type: application/json" \ --url 'https://mdb.api.cloud.yandex.net/managed-greenplum/v1/clusters/<cluster_ID>' \ --data '{ "updateMask": "masterConfig.resources.diskTypeId,masterConfig.resources.diskSize,segmentConfig.resources.diskTypeId,segmentConfig.resources.diskSize", "masterConfig": { "resources": { "diskTypeId": "<disk_type>", "diskSize": "<storage_size_in_bytes>" } }, "segmentConfig": { "resources": { "diskTypeId": "<disk_type>", "diskSize": "<storage_size_in_bytes>" } } }'
Where:
-
updateMask
: List of parameters to update as a single string, separated by commas. -
masterConfig.resources
,segmentConfig.resources
: Storage parameters for master hosts and segment hosts:diskTypeId
: Disk type.diskSize
: New storage size in bytes.
You can request the cluster ID with the 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.Update call and send the following request, e.g., via gRPCurl
:Warning
The API method will assign default values to all the parameters of the object you are modifying unless you explicitly provide them in your request. To avoid this, list the settings you want to change in the
update_mask
parameter as an array ofpaths[]
strings.Format for listing settings
"update_mask": { "paths": [ "<setting_1>", "<setting_2>", ... "<setting_N>" ] }
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>", "update_mask": { "paths": [ "master_config.resources.disk_type_id", "master_config.resources.disk_size", "segment_config.resources.disk_type_id", "segment_config.resources.disk_size" ] }, "master_config": { "resources": { "disk_type_id": "<disk_type>", "disk_size": "<storage_size_in_bytes>" } }, "segment_config": { "resources": { "disk_type_id": "<disk_type>", "disk_size": "<storage_size_in_bytes>" } } }' \ mdb.api.cloud.yandex.net:443 \ yandex.cloud.mdb.greenplum.v1.ClusterService.Update
Where:
-
update_mask
: List of parameters to update as an array ofpaths[]
strings. -
master_config.resources
,segment_config.resources
: Storage parameters for master hosts and segment hosts:disk_type_id
: Disk type.disk_size
: New storage size in bytes.
You can request the cluster ID with the list of clusters in the folder.
-
-
View the server response to make sure the request was successful.
Expanding a cluster
You can add segment hosts to a Managed Service for Greenplum® cluster by expanding it. You need to add at least two hosts. You can also increase the number of segments per host when expanding a cluster.
Changing the cluster's availability zone
All Managed Service for Greenplum® cluster hosts are located in the same Yandex Cloud availability zone. You cannot migrate a cluster to a different availability zone. If you need to change the availability zone, restore the cluster from a backup. When restoring from a backup, specify a new availability zone in the new cluster's settings.
For clusters with hosts residing in the ru-central1-d
availability zone, local SSD storage is not available if using Intel Cascade Lake.
Greenplum® and Greenplum Database® are registered trademarks or trademarks of Broadcom Inc. in the United States and/or other countries.