Updating a subcluster
You can perform the following actions for any subcluster:
- Change the number of hosts.
- Change the host class.
- Change the autoscaling rule for data processing subclusters.
- Expand the storage.
- Edit security groups.
You can also switch availability zones for subclusters. By doing so, you will be migrating them to a different availability zone along with the Yandex Data Processing cluster. This process depends on the cluster type:
- Migrating a lightweight cluster to a different availability zone.
- Migrating an HDFS cluster to a different availability zone.
Changing the number of hosts
You can change the number of hosts in data storage and processing subclusters:
- Open the folder dashboard
. - Navigate to Yandex Data Processing.
- Click the name of your cluster and select the Subclusters tab.
- Click
for the subcluster you need and select Edit. - Enter or select the required number of hosts in the Hosts field.
- Optionally, specify the decommissioning timeout.
- Click Save changes.
Yandex Data Processing will start adding hosts.
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 the number of hosts for a subcluster:
-
View the description of the CLI command for updating a subcluster:
yc dataproc subcluster update --help -
Run this command to update the subcluster, specifying the new number of hosts:
yc dataproc subcluster update <subcluster_name_or_ID> \ --cluster-name=<cluster_name> \ --hosts-count=<number_of_hosts>You can get the subcluster ID and name with the list of subclusters in the cluster, and the cluster name, 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.
-
In the description of the Yandex Data Processing cluster, edit the
hosts_countvalue undersubcluster_specfor your data storage or data processing subcluster:resource "yandex_dataproc_cluster" "data_cluster" { ... cluster_config { ... subcluster_spec { name = "<subcluster_name>" ... hosts_count = <number_of_hosts_in_subcluster> } } }
Changing the host class
Warning
Changing host properties through the Yandex Compute Cloud interfaces may result in host failure. To change the cluster host settings, use the Yandex Data Processing interfaces, such as the management console, CLI, Terraform, or API.
You can change the compute capacity of hosts in a specific subcluster. It depends on the driver deploy mode:
- In
deployMode=clustermode, when the driver runs on one of the cluster'scomputehosts, a subcluster with themasterhost requires 4–8 CPU cores and 16 GB of RAM. - In
deployMode=clientmode, when the driver run on the cluster's master host, the compute capacity depends on the job logic and the number of concurrent jobs.
For more information on driver deploy modes and computing resource usage, see Resource allocation.
To change the host class for a subcluster:
- In the management console
, select the folder with the cluster whose subcluster you want to change. - Go to Yandex Data Processing and select the cluster.
- Navigate to Subclusters.
- Click
for the subcluster you need and select Edit. - Select the platform and configuration under Host class.
- Optionally, specify the decommissioning timeout.
- Click Save changes.
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 the host class for a subcluster:
-
View the description of the CLI command for updating a subcluster:
yc dataproc subcluster update --help -
Get the list of available host classes (the
ZONE IDScolumn lists the availability zones you can select each class in):yc dataproc resource-preset listResult:
+-----------+--------------------------------+-------+----------+ | ID | ZONE IDS | CORES | MEMORY | +-----------+--------------------------------+-------+----------+ | b3-c1-m4 | ru-central1-a, ru-central1-b, | 2 | 4.0 GB | | | ru-central1-c | | | | ... | +-----------+--------------------------------+-------+----------+ -
Run this command to update the subcluster, specifying the new host class:
yc dataproc subcluster update <subcluster_name_or_ID> \ --cluster-name=<cluster_name> \ --resource-preset=<host_class>You can request the subcluster name or ID with the list of cluster subclusters, and the cluster name, with the list of folder clusters.
-
Open the current Terraform configuration file with the infrastructure plan.
To learn how to create this file, refer to Creating a cluster.
-
In the description of the Yandex Data Processing cluster, edit the
resource_preset_idvalue undersubcluster_spec.resourcesfor your subcluster:resource "yandex_dataproc_cluster" data_cluster { ... cluster_config { ... subcluster_spec { name = "<subcluster_name>" ... resources { resource_preset_id = "<subcluster_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 resource changes.
-
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 about the resources you can create with Terraform, see this provider guide.
Yandex Data Processing will start updating the subcluster. Note that this will restart all hosts in the subcluster being updated.
Changing the autoscaling rule for data processing subclusters
You can configure the autoscaling rule in data processing subclusters.
Make sure your cloud quota is sufficient to scale up the VMs. Open the Quotas
- Total HDD capacity
- Total SSD capacity
- Number of disks
- Number of vCPUs for instances
- Number of instances.
To enable autoscaling, assign the following roles to the Yandex Data Processing cluster service account:
- dataproc.agent: To enable the service account to get info on cluster host states, jobs, and log groups.
- dataproc.provisioner: To enable the service account to work with an autoscaling instance group. This will enable subcluster autoscaling.
- resource-manager.auditor or higher for the folder where you want to create a Yandex Data Processing cluster: For connection to the cluster using OS Login.
Tip
To restrict the permissions of a cluster's service account (its IAM token is available when running jobs):
To configure autoscaling for subclusters:
- Open the folder dashboard
. - Navigate to Yandex Data Processing.
- Select the cluster and open the Subclusters tab.
- Click
for the subcluster you need and select Edit. - Under Scaling, enable Autoscaling if it is disabled.
- Configure the autoscaling settings.
- The default metric used for autoscaling is
yarn.cluster.containersPending. To enable scaling based on CPU utilization, disable the Default scaling setting and specify the target CPU utilization level. - Click Save changes.
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 configure autoscaling for subclusters:
-
View the description of the CLI command for updating a subcluster:
yc dataproc subcluster update --help -
Run this command to update the subcluster, specifying the autoscaling settings:
yc dataproc subcluster update <subcluster_name_or_ID> \ --cluster-name=<cluster_name> \ --hosts-count=<minimum_number_of_hosts> \ --max-hosts-count=<maximum_number_of_hosts> \ --enable-preemptible=<using_preemptible_VMs> \ --warmup-duration=<VM_warmup_period> \ --stabilization-duration=<stabilization_period> \ --measurement-duration=<load_measurement_interval> \ --cpu-utilization-target=<target_CPU_utilization> \ --autoscaling-decommission-timeout=<decommissioning_timeout>Where:
--hosts-count: Minimum number of hosts (VMs) in a subcluster. The minimum value is1, and the maximum value is32.--max-hosts-count: Maximum number of hosts (VMs) in a subcluster. The minimum value is1, and the maximum value is100.--enable-preemptible: Specifies if preemptible VMs are used. It can be eithertrueorfalse.--warmup-duration: Time required to warm up a VM, in<value>sformat. The minimum value is0s, and the maximum value is600s.--stabilization-duration: Period, in seconds, during which the required number of VMs cannot be decreased, in<value>sformat. The minimum value is60sand the maximum value is1800s.--measurement-duration: Period, in seconds, for which average utilization is calculated for each VM, in<value>sformat. The minimum value is60s(1 minute), and the maximum value is600s(10 minutes).--cpu-utilization-target: Target CPU utilization, in %. Use this setting to enable scaling based on CPU utilization. Otherwise,yarn.cluster.containersPendingwill be used for scaling based on the number of pending resources. The minimum value is10, and the maximum value is100.--autoscaling-decommission-timeout: Decommissioning timeout, in seconds. The minimum value is0, and the maximum value is86400(24 hours).
You can get the subcluster ID and name with the list of subclusters in the cluster, and the cluster name, with the list of clusters in the folder.
To configure autoscaling for subclusters:
-
Open the current Terraform configuration file with the infrastructure plan.
To learn how to create this file, refer to Creating a cluster.
-
In the description of the Yandex Data Processing cluster, add a section named
subcluster_spec.autoscaling_configwith the required autoscaling settings for your subcluster:resource "yandex_dataproc_cluster" "data_cluster" { ... cluster_config { ... subcluster_spec { name = "<subcluster_name>" role = "COMPUTENODE" ... autoscaling_config { max_hosts_count = <maximum_number_of_VMs_in_group> measurement_duration = <load_measurement_interval> warmup_duration = <warmup_period> stabilization_duration = <stabilization_period> preemptible = <use_of_preemptible_VMs> cpu_utilization_target = <target_CPU_utilization> decommission_timeout = <decommissioning_timeout> } }Where:
max_hosts_count: Maximum number of hosts (VMs) in a subcluster. The minimum value is1, and the maximum value is100.measurement_duration: Period, in seconds, for which average utilization is calculated for each VM, in<value>sformat. The minimum value is60s(1 minute), and the maximum value is600s(10 minutes).warmup_duration: Time required to warm up a VM, in<value>sformat. The minimum value is0s, and the maximum value is600s.stabilization_duration: Period, in seconds, during which the required number of VMs cannot be decreased, in<value>sformat. The minimum value is60sand the maximum value is1800s.preemptible: Indicates if preemptible VMs are used. It can be eithertrueorfalse.cpu_utilization_target: Target CPU utilization, in %. Use this setting to enable scaling based on CPU utilization. Otherwise,yarn.cluster.containersPendingwill be used for scaling based on the number of pending resources. The minimum value is10, and the maximum value is100.decommission_timeout: Decommissioning timeout, in seconds. The minimum value is0, and the maximum value is86400(24 hours).
-
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 resource changes.
-
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 about the resources you can create with Terraform, see this provider guide.
Expanding a storage
Warning
Changing host properties through the Yandex Compute Cloud interfaces may result in host failure. To change the cluster host settings, use the Yandex Data Processing interfaces, such as the management console, CLI, Terraform, or API.
You can expand the storage allocated to each host in a specific subcluster.
Note
Currently, you cannot reduce the storage size. To do so, you must re-create the Yandex Data Processing subcluster.
Make sure the cloud quota is sufficient to increase the VM resources. Open the Quotas
- Total HDD capacity.
- Total SSD capacity.
- Number of disks.
To change the storage size for a subcluster:
- In the management console
, select the folder with the cluster whose subcluster you want to change. - Navigate to Yandex Data Processing and select the cluster.
- Navigate to Subclusters.
- Click
for the subcluster you need and select Edit. - Enter or select the storage size you need under Storage size.
- Click Save changes.
Yandex Data Processing will start updating the subcluster.
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 the storage size for a subcluster:
-
View the description of the CLI command for updating a subcluster:
yc dataproc subcluster update --help -
Run this command to update the subcluster, specifying the storage size you need:
yc dataproc subcluster update <subcluster_name_or_ID> \ --cluster-name=<cluster_name> \ --disk-size=<storage_size_in_GB>You can request the subcluster name or ID with the list of cluster subclusters, and the cluster name, with the list of folder clusters.
If all these conditions are met, Yandex Data Processing starts expanding the storage.
To expand the subcluster storage:
-
Open the current Terraform configuration file with the infrastructure plan.
To learn how to create this file, refer to Creating a cluster.
-
In the description of the Yandex Data Processing cluster, edit the
disk_sizevalue undersubcluster_spec.resourcesfor your subcluster:resource "yandex_dataproc_cluster" "data_cluster" { ... cluster_config { ... subcluster_spec { name = "<subcluster_name>" ... resources { 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 resource changes.
-
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 about the resources you can create with Terraform, see this provider guide.
Updating security groups
- Open the folder dashboard
. - Navigate to Yandex Data Processing.
- Click the name of your cluster and select the Hosts tab.
- Click the host name.
- Under Network, click
and select Edit. - Select the security groups.
- Click Save.
-
Open the current Terraform configuration file with the infrastructure plan.
To learn how to create this file, refer to Creating a cluster.
-
Edit the
security_group_idsvalue in the cluster description:resource "yandex_dataproc_cluster" "data_cluster" { ... security_group_ids = [ "<list_of_cluster_security_group_IDs>" ] } -
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 resource changes.
-
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 about the resources you can create with Terraform, see this provider guide.
Warning
You may need to additionally configure security groups to enable access to your cluster.