Trino cluster maintenance
You can manage maintenance of a Yandex Managed Service for Trino cluster.
Getting a list of maintenance jobs
- Open the folder dashboard
. - Navigate to Managed Service for Trino.
- Click the name of your cluster and select the Maintenance tab.
To view maintenance jobs with a specific status, click Status above the maintenance list and select the status you want from the drop-down menu. To find a specific maintenance job, enter its ID or task name in the field above the list of maintenance sessions.
Getting cluster maintenance logs
- Open the folder dashboard
. - Navigate to Managed Service for Trino.
- Click the name of your cluster and select the Maintenance tab.
- Click the ID of the maintenance job you need.
- Click Task logs.
Moving scheduled maintenance
Maintenance with the Planned status is scheduled for the date and time specified in the Start date column. You can reschedule them to a new date and time if needed.
To reschedule maintenance for a new date and time:
- Open the folder dashboard
. - Navigate to Managed Service for Trino.
- Click the name of your cluster and select the Maintenance tab.
- Click
next to the maintenance with the Planned status. - In the drop-down menu, select
Postpone. - In the window that opens:
- To postpone the maintenance until the next available window, click Next window and then Reschedule.
- To move a maintenance forward or backward to a specific UTC date and time, click Choose date (UTC), then select a new date and time and click Reschedule.
Starting scheduled maintenance immediately
If you need to, you can perform a maintenance with the Planned status immediately without waiting for the time specified in the Start date column.
To run a scheduled cluster maintenance job immediately:
- Open the folder dashboard
. - Navigate to Managed Service for Trino.
- Click the name of your cluster and select the Maintenance tab.
- Click
next to the maintenance. - In the drop-down menu, select
Carry out now.
Configuring a maintenance window
By default, maintenance can be scheduled for any time. You can choose a specific day of the week and time interval to schedule maintenance. For example, you can choose the time when the cluster is least busy.
- Open the folder dashboard
. - Navigate to Managed Service for Trino.
- Click the name of your cluster and select the Maintenance tab.
- Click
Configure the maintenance window. - In the window that opens:
- To allow maintenance at any time, select At any time, which is also the default option.
- To allow weekly maintenance at a specific time, select By schedule and specify the weekday and UTC time interval.
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 specify a different folder for any command using --folder-name or --folder-id. If you access a resource by its name, the search will be limited to the default folder. If you access a resource by its ID, the search will be global, i.e., through all folders based on access permissions.
To change your maintenance window settings:
-
View the description of the CLI command for updating a cluster:
yc managed-trino cluster update --help -
Run this command:
yc managed-trino cluster update <cluster_name_or_ID> \ --deletion-protection \ --maintenance-window type=<maintenance_type>,` `day=<day_of_week>,` `hour=<sequence_number_of_hour_interval>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: Sequence number of UTC hour interval, from1to24.For example,
1stands for the interval from00:00to01:00, and5, from04:00to05:00.
-
You can get the cluster name and ID with the list of clusters in the folder.
-
Open the current Terraform configuration file with the infrastructure plan.
To learn how to create this file, refer to Creating a cluster.
-
To change maintenance time (including for disabled clusters), add the
maintenance_windowsection to the cluster description:resource "yandex_trino_cluster" "<cluster_name>" { ... maintenance_window = { type = <maintenance_type> day = <day_of_week> hour = <sequence_number_of_hour_interval> } ... }Where:
-
type: Maintenance type. The possible values include:ANYTIME: Any time.WEEKLY: On a schedule.
-
day: Day of week for theWEEKLYtype, i.e.,MON,TUE,WED,THU,FRI,SAT, orSUN. -
hour: Sequence number of UTC hour interval for theWEEKLYtype, from1to24.For example,
1stands for the interval from00:00to01:00, and5, from04:00to05:00.
You can get the cluster name with the list of clusters in the folder.
-
-
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.
-
-
-
Get an IAM token for API authentication and put it into an environment variable:
export IAM_TOKEN="<IAM_token>" -
Create a file named
body.jsonand paste the following code into it:{ "updateMask": "maintenanceWindow", "maintenanceWindow": { "weeklyMaintenanceWindow": { "day": "<day_of_week>", "hour": "<sequence_number_of_hour_interval>" } } }Where:
-
updateMask: Comma-separated string of settings to update.Here, we provide only one setting.
-
maintenanceWindow: Maintenance window settings, applying to both running and stopped clusters. Provide one of these two properties:-
anytime: Maintenance takes place at any time. -
weeklyMaintenanceWindow: Maintenance takes place once a week at the specified time:-
day: Day of week, i.e.,MON,TUE,WED,THU,FRI,SAT, orSUN. -
hour: UTC hour interval, from1to24.For example,
1stands for the interval from00:00to01:00, and5, from04:00to05:00.
-
-
-
-
Call the Cluster.Update method, e.g., via the following cURL
request:curl \ --request PATCH \ --header "Authorization: Bearer $IAM_TOKEN" \ --url 'https://trino.api.cloud.yandex.net/managed-trino/v1/clusters/<cluster_ID>' --data '@body.json'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. -
Create a file named
body.jsonand paste the following code into it:{ "cluster_id": "<cluster_ID>", "update_mask": { "paths": ["maintenance_window"] }, "maintenance_window": { "weekly_maintenance_window": { "day": "<day_of_week>", "hour": "<sequence_number_of_hour_interval>" } } }Where:
-
cluster_id: Cluster ID.You can get the cluster ID with the list of clusters in the folder.
-
update_mask: List of settings to update as an array of strings (paths[]).Here, we provide only one setting.
-
maintenance_window: Maintenance window settings (including for disabled clusters). Provide one of these two properties:-
anytime: Maintenance takes place at any time. -
weekly_maintenance_window: Maintenance takes place once a week at the specified time:-
day: Day of week, i.e.,MON,TUE,WED,THU,FRI,SAT, orSUN. -
hour: UTC hour interval, from1to24.For example,
1stands for the interval from00:00to01:00, and5, from04:00to05:00.
-
-
-
-
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/trino/v1/cluster_service.proto \ -rpc-header "Authorization: Bearer $IAM_TOKEN" \ -d @ \ trino.api.cloud.yandex.net:443 \ yandex.cloud.trino.v1.ClusterService.Update \ < body.json -
Check the server response to make sure your request was successful.