Yandex MPP Analytics for PostgreSQL cluster maintenance
You can manage maintenance of a Yandex MPP Analytics for PostgreSQL cluster.
Getting a list of maintenance jobs
- Open the folder dashboard
. - Navigate to Yandex MPP Analytics for PostgreSQL.
- Click the cluster name and open the
Maintenance tab. - Optionally, select a maintenance status above the maintenance list.
Getting cluster maintenance logs
- Open the folder dashboard
. - Navigate to Yandex MPP Analytics for PostgreSQL.
- Click the cluster name and open the
Maintenance tab. - Select the maintenance. The maintenance page will open.
- Click Task logs.
Postponing scheduled maintenance
-
Open the folder dashboard
. -
Navigate to Yandex MPP Analytics for PostgreSQL.
-
Click the cluster name and open the
Maintenance tab. -
Click
next to the maintenance with the Planned status and select Postpone. -
Select the reschedule type for the planned maintenance:
-
Next window: Reschedule to the next maintenance window.
-
Choose date (UTC): Reschedule to a specific date and time interval (UTC).
For this option, select the date and UTC time interval.
Maintenance can be postponed for a maximum of two weeks from the original scheduled date.
-
-
Click Reschedule.
If you do not have the Yandex Cloud CLI yet, install and initialize it.
The folder used by default is the one specified when creating the CLI 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 options.
To postpone scheduled maintenance:
-
View the description of the CLI command for rescheduling maintenance:
yc managed-greenplum cluster reschedule-maintenance --help -
Reschedule the maintenance:
yc managed-greenplum cluster reschedule-maintenance <cluster_name_or_ID> \ --reschedule-type <reschedule_type>Where
reschedule_typeis reschedule type:-
next-available-window: Next available maintenance window. -
specific-time: Specific date and time, UTC.For this value, also use the
--delayed-untilparameter to provide a timestamp in one of these formats:- RFC 3339
. - HH:MM:SS.
- Relative time to postpone maintenance for.
Here are some examples:
2006-01-02T15:04:05Z,15:04:05,2h,3h30m ago.Maintenance can be postponed for a maximum of two weeks from the original scheduled date.
- RFC 3339
You can get the cluster name and ID with the list of clusters in the folder.
-
-
Get an IAM token for API authentication and put it into an environment variable:
export IAM_TOKEN="<IAM_token>" -
Call the Cluster.RescheduleMaintenance method, e.g., via the following cURL
request:curl \ --request POST \ --header "Authorization: Bearer $IAM_TOKEN" \ --header "Content-Type: application/json" \ --url 'https://mdb.api.cloud.yandex.net/managed-greenplum/v1/clusters/<cluster_ID>:rescheduleMaintenance' \ --data '{ "rescheduleType": "<reschedule_type>" }'Where
reschedule_typeis reschedule type:-
NEXT_AVAILABLE_WINDOW: Next available maintenance window. -
SPECIFIC_TIME: Specific date and time, UTC.For this value, also use the
delayedUntilparameter to provide a timestamp in RFC 3339 format. Here is an example:2006-01-02T15:04:05ZMaintenance can be postponed for a maximum of two weeks from the original scheduled date.
You can get 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 put it into 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 that the repository contents reside in the
~/cloudapi/directory. -
Call the ClusterService.RescheduleMaintenance method, e.g., via the following gRPCurl
request: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>", "reschedule_type": "<reschedule_type>" }' \ mdb.api.cloud.yandex.net:443 \ yandex.cloud.mdb.greenplum.v1.ClusterService.RescheduleMaintenanceWhere
reschedule_typeis reschedule type:-
NEXT_AVAILABLE_WINDOW: Next available maintenance window. -
SPECIFIC_TIME: Specific date and time, UTC.For this value, also use the
delayed_untilparameter to provide a timestamp in RFC 3339 format. Here is an example:2006-01-02T15:04:05ZMaintenance can be postponed for a maximum of two weeks from the original scheduled date.
You can get the cluster ID with the list of clusters in the folder.
-
-
Check the server response to make sure your request was successful.
Starting scheduled maintenance immediately
- Open the folder dashboard
. - Navigate to Yandex MPP Analytics for PostgreSQL.
- Click the cluster name and open the
Maintenance tab. - In the maintenance row, click
and select Carry out now.
If you do not have the Yandex Cloud CLI yet, install and initialize it.
The folder used by default is the one specified when creating the CLI 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 options.
To start scheduled maintenance immediately, do the following:
-
View the description of the CLI command for rescheduling maintenance:
yc managed-greenplum cluster reschedule-maintenance --help -
Start scheduled maintenance immediately:
yc managed-greenplum cluster reschedule-maintenance <cluster_name_or_ID> \ --reschedule-type immediateYou can get the cluster name and ID with the list of clusters in the folder.
-
Get an IAM token for API authentication and put it into an environment variable:
export IAM_TOKEN="<IAM_token>" -
Call the Cluster.RescheduleMaintenance method, e.g., via the following cURL
request:curl \ --request POST \ --header "Authorization: Bearer $IAM_TOKEN" \ --header "Content-Type: application/json" \ --url 'https://mdb.api.cloud.yandex.net/managed-greenplum/v1/clusters/<cluster_ID>:rescheduleMaintenance' \ --data '{ "rescheduleType": "IMMEDIATE" }'You can get 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 put it into 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 that the repository contents reside in the
~/cloudapi/directory. -
Call the ClusterService.RescheduleMaintenance method, e.g., via the following gRPCurl
request: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>", "reschedule_type": "IMMEDIATE" }' \ mdb.api.cloud.yandex.net:443 \ yandex.cloud.mdb.greenplum.v1.ClusterService.RescheduleMaintenanceYou can get the cluster ID with the list of clusters in the folder.
-
Check the server response to make sure your request was successful.
Configuring a maintenance window
-
Open the folder dashboard
. -
Navigate to Yandex MPP Analytics for PostgreSQL.
-
Click the cluster name and open the
Maintenance tab. -
Click
Configure the maintenance window in the top-right corner of the page. -
Select a maintenance window:
-
arbitrary: Maintenance takes place at any time.
-
by schedule: Maintenance is scheduled for the selected day of the week and UTC time interval.
For this type of maintenance, define the start of the maintenance window: select the day of the week and UTC time interval.
-
-
Click Save.
If you do not have the Yandex Cloud CLI yet, install and initialize it.
The folder used by default is the one specified when creating the CLI 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 options.
To set a maintenance window:
-
See the description of the CLI command for updating cluster settings:
yc managed-greenplum cluster update --help -
Set up a maintenance window:
yc managed-greenplum cluster update <cluster_name_or_ID> \ --maintenance-window type=<maintenance_type>,` `day=<day_of_week>,` `hour=<hour>Where
typeis the maintenance type:anytime: At any time (default).weekly: On a schedule. For this value, also specify the following:day: Day of week, i.e.,MON,TUE,WED,THU,FRI,SAT, orSUN.hour: Hour of day (UTC), from1to24.
You can get the cluster name and ID with the list of clusters in the folder.
-
Open the current Terraform configuration file describing your infrastructure.
For more on how to create this file, see Creating a cluster.
For a complete list of configurable Greenplum® cluster fields, see this Terraform provider guide.
-
To set up a maintenance window, add the
maintenance_windowsection to the cluster description:resource "yandex_mdb_greenplum_cluster" "<local_cluster_name>" { ... maintenance_window { type = "<maintenance_type>" } ... }Where
typeis the maintenance type:-
ANYTIME: Any time (default). -
WEEKLY: On a schedule. For this value, also specify the following:day: Day of week, i.e.,MON,TUE,WED,THU,FRI,SAT, orSUN.hour: Hour of day (UTC), from1to24.
-
-
Validate your configuration.
-
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 put it into an environment variable:
export IAM_TOKEN="<IAM_token>" -
Call the Cluster.Update method, e.g., via the following cURL
request: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": "maintenanceWindow", "maintenanceWindow": { "weeklyMaintenanceWindow": { "day": "<day_of_week>", "hour": "<hour>" } } }'Where:
-
updateMask: Comma-separated string of settings to update.In this example, only the
maintenanceWindowsetting is provided.Warning
When you update a cluster, all parameters of the object you are modifying will take their defaults unless explicitly provided in the request. To avoid this, list the settings you want to change in the
updateMaskparameter. -
maintenanceWindow: Maintenance window settings. Provide one of the values:-
anytime: Allows performing maintenance at any time; default option.This parameter is provided as an empty object:
"anytime": {}. -
weekly_maintenance_window: Maintenance takes place once a week at the specified time:day: Day of week inDDDformat, i.e.,MON,TUE,WED,THU,FRI,SAT, orSUN.hour: Time of day (UTC), from1to24.
-
You can get 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 put it into 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 that the repository contents reside in the
~/cloudapi/directory. -
Call the ClusterService.Update method, e.g., via the following gRPCurl
request: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": [ "maintenance_window" ] }, "maintenance_window": { "weekly_maintenance_window": { "day": "<day_of_week>", "hour": "<hour>" } } }' \ mdb.api.cloud.yandex.net:443 \ yandex.cloud.mdb.greenplum.v1.ClusterService.UpdateWhere:
-
update_mask: List of settings to update as an array of strings (paths[]).Format for listing settings
"update_mask": { "paths": [ "<setting_1>", "<setting_2>", ... "<setting_N>" ] }In this example, only the
maintenance_windowsetting is provided.Warning
When you update a cluster, all parameters of the object you are modifying will take their defaults unless explicitly provided in the request. To avoid this, list the settings you want to change in the
update_maskparameter. -
maintenance_window: Maintenance window settings. Provide one of the values:-
anytime: Allows performing maintenance at any time; default option.This parameter is provided as an empty object:
"anytime": {}. -
weekly_maintenance_window: Maintenance takes place once a week at the specified time:day: Day of week inDDDformat, i.e.,MON,TUE,WED,THU,FRI,SAT, orSUN.hour: Time of day (UTC), from1to24.
-
You can get the cluster ID with the list of clusters in the folder.
-
-
Check the server response to make sure your request was successful.