Updating a Greenplum® cluster's 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 and segment hosts. Switching the host class will change the cluster's primary master host.
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 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 your 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 Yandex MPP Analytics for PostgreSQL.
- Select the cluster and click
Edit in the top panel. - Under Host class, select the relevant class for Greenplum® master hosts or segment hosts.
- Click Save changes.
If you do not have the Yandex Cloud CLI installed yet, install and initialize it.
By default, the CLI uses the folder specified when creating the profile. To change the default folder, use the yc config set folder-id <folder_ID> command. You can also set a different folder for any specific command using the --folder-name or --folder-id parameter.
To change the host class for a cluster:
-
View the description of the CLI command for updating a cluster:
yc managed-greenplum cluster update --help -
Request a list of available classes (the
ZONE IDScolumn 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 relevant 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>Yandex MPP Analytics for PostgreSQL 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 configuration fields you can edit for a Yandex MPP Analytics for PostgreSQL cluster, see the Terraform provider guide.
-
In the Yandex MPP Analytics for PostgreSQL cluster description, edit the value of the
resource_preset_idattribute undermaster_subcluster.resourcesorsegment_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 validateTerraform will show any errors found in your configuration files.
-
-
Confirm updating the resources.
-
Run this command to view the planned changes:
terraform planIf 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 Yandex MPP Analytics for PostgreSQL cluster operations to complete to 120 minutes.
Operations exceeding the set timeout are interrupted.
How do I change these limits?
Add the
timeoutsblock 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 save it as an environment variable:
export IAM_TOKEN="<IAM_token>" -
Call the Cluster.Update method, e.g., via the following cURL
request: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
updateMaskparameter 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 settings to update as a single string, separated by commas. -
masterConfig.resources.resourcePresetIdandsegmentConfig.resources.resourcePresetId: New host class for master and segment hosts.
You can request the cluster ID with the list of clusters in the folder.
-
-
Check the server response to make sure your request was successful.
-
Get an IAM token for API authentication and save it as an environment variable:
export IAM_TOKEN="<IAM_token>" -
Clone the cloudapi
repository:cd ~/ && git clone --depth=1 https://github.com/yandex-cloud/cloudapiBelow, 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_maskparameter 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.UpdateWhere:
-
update_mask: List of settings to update as an array ofpaths[]strings. -
master_config.resources.resource_preset_idandsegment_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.
-
-
Check the server response to make sure your request was successful.
Changing the disk type and increasing 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 Yandex MPP Analytics for PostgreSQL.
-
Select the cluster in question.
-
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 installed yet, install and initialize it.
By default, the CLI uses the folder specified when creating the profile. To change the default folder, use the yc config set folder-id <folder_ID> command. You can also set a different folder for any specific command using the --folder-name or --folder-id parameter.
To increase your cluster storage size:
-
View the description of the CLI command for updating a cluster:
yc managed-greenplum cluster update --help -
Specify the required storage size for master or segment hosts in the cluster update command (at least as large as
disk_sizein 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 configuration fields you can edit for a Yandex MPP Analytics for PostgreSQL cluster, see the Terraform provider guide.
-
In the Yandex MPP Analytics for PostgreSQL cluster description, edit the values of the
disk_type_idanddisk_sizeattributes undermaster_subcluster.resourcesorsegment_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 validateTerraform will show any errors found in your configuration files.
-
-
Confirm updating the resources.
-
Run this command to view the planned changes:
terraform planIf 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 Yandex MPP Analytics for PostgreSQL cluster operations to complete to 120 minutes.
Operations exceeding the set timeout are interrupted.
How do I change these limits?
Add the
timeoutsblock 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 save it as an environment variable:
export IAM_TOKEN="<IAM_token>" -
Call the Cluster.Update method, e.g., via the following cURL
request: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
updateMaskparameter 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 settings to update as a single string, separated by commas. -
masterConfig.resources,segmentConfig.resources: Storage properties 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.
-
-
Check the server response to make sure your request was successful.
-
Get an IAM token for API authentication and save it as an environment variable:
export IAM_TOKEN="<IAM_token>" -
Clone the cloudapi
repository:cd ~/ && git clone --depth=1 https://github.com/yandex-cloud/cloudapiBelow, 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_maskparameter 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.UpdateWhere:
-
update_mask: List of settings to update as an array ofpaths[]strings. -
master_config.resources,segment_config.resources: Storage properties 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 your request was successful.
Expanding a cluster
You can add segment hosts to a Yandex MPP Analytics for PostgreSQL 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 hosts of a Yandex MPP Analytics for PostgreSQL cluster 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.