Updating an Trino cluster
Note
The service is at the Preview stage.
After creating a cluster, you can edit its basic and advanced settings.
To change the cluster settings:
-
Navigate to the folder dashboard
and select Managed Service for Trino. -
Select the cluster and click Edit in the top panel.
-
Under Basic parameters:
-
Edit the cluster name and description.
-
Delete or add new labels.
-
Select a service account or create a new one with the
managed-trino.integrationProvider
andstorage.editor
roles. The cluster will thus get the permissions it needs to work with user resources.To change your service account in a Managed Service for Trino cluster, make sure your Yandex Cloud account has the iam.serviceAccounts.user role or higher.
Warning
If the cluster already uses a service account to access objects from Object Storage, then changing it to a different service account may make these objects unavailable and interrupt the cluster operation. Before changing the service account settings, make sure that the cluster doesn't use the objects in question.
-
-
Under Network settings, select the cluster security group.
-
Change the configuration of the coordinator and workers.
-
Under Advanced settings, enable or disable cluster deletion protection.
-
Under Advanced settings, enable or disable logging. If logging is enabled, specify the log group or folder to write logs to and the minimum logging level.
-
Click Save changes.
To change the cluster settings:
-
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:Note
This example does not use all available parameters. For a list of all parameters, see the API documentation.
{ "updateMask": "<list_of_parameters_to_update>", "name": "<cluster_name>", "description": "<cluster_description>", "labels": { <label_list> }, "trino": { "coordinatorConfig": { "resources": { "resourcePresetId": "<resource_ID>" } }, "workerConfig": { "resources": { "resourcePresetId": "<resource_ID>" }, "scalePolicy": { "autoScale": { "minCount": "<minimum_number_of_instances>", "maxCount": "<maximum_number_of_instances>" } } } }, "networkSpec": { "securityGroupIds": [ <list_of_security_group_IDs> ] }, "deletionProtection": "<deletion_protection>", "serviceAccountId": "<service_account_ID>", "logging": { "enabled": "<use of_logging>", "folderId": "<folder_ID>", "minLevel": "<logging_level>" } }
Where:
-
updateMask
: List of parameters to update as a single string, separated by commas.Warning
When you update a cluster, all parameters of the object you are changing that were not explicitly provided in the request will be overriden by their defaults. To avoid this, list the settings you want to change in the
updateMask
parameter. -
name
: Cluster name. -
description
: Cluster description. -
labels
: List of labels. Provide labels in"<key>": "<value>"
format. -
trino
: Configuration of Trino cluster components.-
coordinatorConfig
: Coordinator configuration.-
resources.resourcePresetId
: ID of the coordinator’s computing resources. The possible values are:c4-m16
: 4 vCPUs, 16 GB RAMc8-m32
: 8 vCPUs, 32 GB RAM
-
-
workerConfig
: Worker configuration.-
resources.resourcePresetId
: ID of the worker’s computing resources. The possible values are:c4-m16
: 4 vCPUs, 16 GB RAMc8-m32
: 8 vCPUs, 32 GB RAM
-
scalePolicy
: Worker scaling policy:-
fixedScale
: Fixed scaling policy.count
: Number of workers.
-
fixed_scale
: Automatic scaling policy.minCount
: Minimum number of workers.maxCount
: Maximum number of workers.
Specify one of the two parameters:
fixedScale
orautoScale
. -
-
-
-
networkSpec
: Network settings:securityGroupIds
: List of security group IDs.
-
deletionProtection
: Enables cluster protection against accidental deletion. The possible values aretrue
orfalse
.Even if it is enabled, one can still connect to the cluster manually and delete it.
-
serviceAccountId
: Service account ID. -
logging
: Logging parameters:enabled
: Enables logging. Logs generated by Trino components will be sent to Yandex Cloud Logging. The possible values aretrue
orfalse
.minLevel
: Minimum logging level. Possible values:TRACE
,DEBUG
,INFO
,WARN
,ERROR
, andFATAL
.folderId
: Folder ID. Logs will be written to the default log group for this folder.logGroupId
: Custom log group ID. Logs will be written to this group.
Specify one of the two parameters:
folderId
orlogGroupId
.
-
-
Use the Cluster.update method and send the following request, e.g., via cURL
: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 request the cluster ID with the list of clusters in the folder.
-
View the server response to make sure the request was successful.
To change the cluster settings:
-
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:Note
This example does not use all available parameters. For a list of all parameters, see the API documentation.
{ "cluster_id": "<cluster_ID>", "update_mask": "<list_of_parameters_to_update>", "name": "<cluster_name>", "description": "<cluster_description>", "labels": { <label_list> }, "trino": { "coordinator_config": { "resources": { "resource_preset_id": "<resource_ID>" } }, "worker_config": { "resources": { "resource_preset_id": "<resource_ID>" }, "scale_policy": { "auto_scale": { "min_count": "<minimum_number_of_instances>", "max_count": "<maximum_number_of_instances>" } } } }, "network_spec": { "security_group_ids": [ <list_of_security_group_IDs> ] }, "deletion_protection": "<deletion_protection>", "service_account_id": "<service_account_ID>", "logging": { "enabled": "<use of_logging>", "folder_id": "<folder_ID>", "min_level": "<logging_level>" } }
Where:
-
cluster_id
: Cluster ID. You can request it with the list of clusters in a folder. -
update_mask
: List of parameters to update as an array ofpaths[]
strings.Format for listing settings
"update_mask": { "paths": [ "<setting_1>", "<setting_2>", ... "<setting_N>" ] }
Warning
When you update a cluster, all parameters of the object you are changing that were not explicitly provided in the request will be overriden by their defaults. To avoid this, list the settings you want to change in the
update_mask
parameter. -
name
: Cluster name. -
description
: Cluster description. -
labels
: List of labels. Provide labels in"<key>": "<value>"
format. -
trino
: Configuration of Trino cluster components.-
coordinator_config
: Coordinator configuration.-
resources.resource_preset_id
: ID of the coordinator’s computing resources. The possible values are:c4-m16
: 4 vCPUs, 16 GB RAMc8-m32
: 8 vCPUs, 32 GB RAM
-
-
worker_config
: Worker configuration.-
resources.resource_preset_id
: ID of the worker’s computing resources. The possible values are:c4-m16
: 4 vCPUs, 16 GB RAMc8-m32
: 8 vCPUs, 32 GB RAM
-
scale_policy
: Worker scaling policy:-
fixed_scale
: Fixed scaling policy.count
: Number of workers.
-
fixed_scale
: Automatic scaling policy.min_count
: Minimum number of workers.max_count
: Maximum number of workers.
Specify one of the two parameters:
fixed_scale
orauto_scale
. -
-
-
-
network_spec
: Network settings:security_group_ids
: List of security group IDs.
-
deletion_protection
: Enables cluster protection against accidental deletion. The possible values aretrue
orfalse
.Even if it is enabled, one can still connect to the cluster manually and delete it.
-
service_account_id
: Service account ID. -
logging
: Logging parameters:enabled
: Enables logging. Logs generated by Trino components will be sent to Yandex Cloud Logging. The possible values aretrue
orfalse
.min_level
: Minimum logging level. Possible values:TRACE
,DEBUG
,INFO
,WARN
,ERROR
, andFATAL
.folder_id
: Folder ID. Logs will be written to the default log group for this folder.log_group_id
: Custom log group ID. Logs will be written to this group.
Specify either
folder_id
orlog_group_id
.
-
-
Use the ClusterService/Update call and send the following request, e.g., via gRPCurl
: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
-
View the server response to make sure the request was successful.