Updating an cluster YTsaurus
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 page
and select Managed Service for YTsaurus. -
Select the cluster and click Edit in the top panel.
-
Under Basic parameters:
- Edit the cluster name and description.
- Delete or add new labels.
-
Under Storage, change the number of disks.
-
Under Exec node configuration, change the number of exec nodes.
-
Click Save changes.
To change the cluster settings:
-
Open the current Terraform configuration file that defines your infrastructure.
For more information about creating this file, see Creating clusters.
-
Edit the cluster settings by changing the value of the relevant field in the configuration file. You can only edit a single setting per cluster resource update operation.
Alert
Do not change the cluster name and ID using Terraform. This will delete the existing cluster and create a new one.
Here is an example of the configuration file structure:
resource "yandex_ytsaurus_cluster" "my_cluster" { description = "<cluster_description>" name = "my-ytsaurus-cluster" folder_id = "b1gmioovukmd********" labels = { <label_list> } ... spec = { ... storage = { hdd = { ... "count": "<number_of_HDDs>" }, ssd = { ... "count": "<number_of_SSDs>", } } compute = [{ ... scale_policy = { fixed = { size = <number_of_exec_nodes> } } }] ... odin = { checks_ttl = "<TTL_of_checks_by_Odin>" } } }Where:
-
description: Cluster description. -
labels: List of labels. Provide labels in<key> = "<value>"format. -
spec: Configuration of YTsaurus cluster components.-
storage: Storage parameters:hdd.count: Number of HDDs. You can only increase the number; reducing it is not supported.ssd.count: Number of SSDs. You can only increase the number; reducing it is not supported.
-
compute: Configuration of exec nodes:scale_policy.fixed.size: Number of exec nodes for the fixed scaling policy. Currently, this is the only policy YTsaurus supports.
-
odin.checks_ttl: TTL of checks by Odin, an internal monitoring tool. Provide the value with measurement units:hfor hours,mfor minutes, andsfor seconds.
-
-
-
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.
-
-
For more information, see this Terraform provider article
To change the cluster settings:
-
Get an IAM token for API authentication and save it as an environment variable:
export IAM_TOKEN="<IAM_token>" -
You can only edit a single setting per cluster update operation. Create a file named
body.jsonwith the required setting from the example below. This example only shows settings to update; for the full list of available settings, see this API guide.{ "clusterId": "<cluster_ID>", "updateMask": "<name_of_setting_to_update>", "name": "<cluster_name>", "description": "<cluster_description>", "labels": { <label_list> }, "spec": { "storage": { "hdd": { "count": "<number_of_HDDs>" }, "ssd": { "count": "<number_of_SSDs>" } }, "compute": [ { "scalePolicy": { "fixed": { "size": "<number_of_exec_nodes>" } } } ], "odin": { "checksTtl": "<TTL_of_checks_by_Odin>" } } }Where:
-
clusterId: Cluster ID. You can get it with the list of clusters in a folder. -
updateMask: Name of the setting you are updating. -
name: Cluster name. -
description: Cluster description. -
labels: List of labels Provide labels in"<key>": "<value>"format. -
spec: Configuration of YTsaurus cluster components.-
storage: Storage parameters:hdd.count: Number of HDDs. You can only increase the number; reducing it is not supported.ssd.count: Number of SSDs. You can only increase the number; reducing it is not supported.
-
compute: Configuration of exec nodes.scalePolicy.fixed.size: Number of exec nodes for the fixed scaling policy. Currently, this is the only policy YTsaurus supports.
-
odin.checksTtl: TTL of checks by Odin, an internal monitoring tool. Provide the value with measurement units:s(seconds).
-
-
-
Use the Cluster.Update method and send the following request, e.g., via cURL
:curl \ --request PATCH \ --header "Authorization: Bearer $IAM_TOKEN" \ --url 'https://ytsaurus.api.cloud.yandex.net/ytsaurus/v1/clusters' --data '@body.json' -
View the server response to make sure your request was successful.
To change the cluster settings:
-
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. -
You can only edit a single setting per cluster update operation. Create a file named
body.jsonwith the required setting from the example below. This example only shows settings to update; for the full list of available settings, see this API guide.{ "cluster_id": "<cluster_ID>", "update_mask": "<name_of_setting_to_update>", "name": "<cluster_name>", "description": "<cluster_description>", "labels": { <label_list> }, "spec": { "storage": { "hdd": { "count": "<number_of_HDDs>" }, "ssd": { "count": "<number_of_SSDs>" } }, "compute": [ { "scale_policy": { "fixed": { "size": "<number_of_exec_nodes>" } } } ], "odin": { "checks_ttl": "<TTL_of_checks_by_Odin>" } } }Where:
-
cluster_id: Cluster ID. You can get it with the list of clusters in a folder. -
update_mask: List of parameters to update as an array ofpaths[]strings.In this case, the array consists of a single element.
Format for listing settings
"update_mask": { "paths": [ "<name_of_setting_to_update>" ] } -
name: Cluster name. -
description: Cluster description. -
labels: List of labels Provide labels in"<key>": "<value>"format. -
spec: Configuration of YTsaurus cluster components.-
storage: Storage parameters:hdd.count: Number of HDDs. You can only increase the number; reducing it is not supported.ssd.count: Number of SSDs. You can only increase the number; reducing it is not supported.
-
compute: Configuration of exec nodes.scale_policy.fixed.size: Number of exec nodes for the fixed scaling policy. Currently, this is the only policy YTsaurus supports.
-
odin.checks_ttl: TTL of checks by Odin, an internal monitoring tool. Provide the value with measurement units:s(seconds).
-
-
-
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/ytsaurus/v1/cluster_service.proto \ -rpc-header "Authorization: Bearer $IAM_TOKEN" \ -d @ \ ytsaurus.api.cloud.yandex.net:443 \ yandex.cloud.ytsaurus.v1.ClusterService.Update \ < body.json -
View the server response to make sure your request was successful.