gcloud alpha dataproc clusters update Stay organized with collections Save and categorize content based on your preferences.
- NAME
- gcloud alpha dataproc clusters update - update labels and/or the number of worker nodes in a cluster
- SYNOPSIS
gcloud alpha dataproc clusters update(CLUSTER:--region=REGION)[--async][--graceful-decommission-timeout=GRACEFUL_DECOMMISSION_TIMEOUT][--min-secondary-worker-fraction=MIN_SECONDARY_WORKER_FRACTION][--num-secondary-workers=NUM_SECONDARY_WORKERS][--num-workers=NUM_WORKERS][--secondary-worker-standard-capacity-base=SECONDARY_WORKER_STANDARD_CAPACITY_BASE][--update-labels=[KEY=VALUE,…]][--autoscaling-policy=AUTOSCALING_POLICY|--disable-autoscaling][--clear-labels|--remove-labels=[KEY,…]][--delete-expiration-time=DELETE_EXPIRATION_TIME|--delete-max-age=DELETE_MAX_AGE|--no-delete-max-age][--delete-max-idle=DELETE_MAX_IDLE|--no-delete-max-idle][--identity-config-file=IDENTITY_CONFIG_FILE|--add-user-mappings=[KEY=VALUE,…]--remove-user-mappings=[KEY,…]][--stop-expiration-time=STOP_EXPIRATION_TIME|--stop-max-age=STOP_MAX_AGE|--no-stop-max-age][--stop-max-idle=STOP_MAX_IDLE|--no-stop-max-idle][GCLOUD_WIDE_FLAG …]
- DESCRIPTION
(ALPHA)Update the number of worker nodes and/or the labels in acluster.- EXAMPLES
- To resize a cluster, run:
gcloudalphadataprocclustersupdatemy-cluster--region=us-central1--num-workers=5To change the number preemptible workers in a cluster, run:
gcloudalphadataprocclustersupdatemy-cluster--region=us-central1--num-preemptible-workers=5To add the label 'customer=acme' to a cluster, run:
gcloudalphadataprocclustersupdatemy-cluster--region=us-central1--update-labels=customer=acmeTo update the label 'customer=ackme' to 'customer=acme', run:
gcloudalphadataprocclustersupdatemy-cluster--region=us-central1--update-labels=customer=acmeTo remove the label whose key is 'customer', run:
gcloudalphadataprocclustersupdatemy-cluster--region=us-central1--remove-labels=customer - POSITIONAL ARGUMENTS
- Cluster resource - The name of the cluster to update. The arguments in thisgroup can be used to specify the attributes of this resource. (NOTE) Someattributes are not given arguments in this group but can be set in other ways.
To set the
projectattribute:- provide the argument
clusteron the command line with a fullyspecified name; - provide the argument
--projecton the command line; - set the property
core/project.
This must be specified.
CLUSTER- ID of the cluster or fully qualified identifier for the cluster.
To set the
clusterattribute:- provide the argument
clusteron the command line.
This positional argument must be specified if any of the other arguments in thisgroup are specified.
- provide the argument
--region=REGION- Dataproc region for the cluster. Each Dataproc region constitutes an independentresource namespace constrained to deploying instances into Compute Engine zonesinside the region. Overrides the default
dataproc/regionpropertyvalue for this command invocation.To set the
regionattribute:- provide the argument
clusteron the command line with a fullyspecified name; - provide the argument
--regionon the command line; - set the property
dataproc/region.
- provide the argument
- provide the argument
- Cluster resource - The name of the cluster to update. The arguments in thisgroup can be used to specify the attributes of this resource. (NOTE) Someattributes are not given arguments in this group but can be set in other ways.
- FLAGS
--async- Return immediately, without waiting for the operation in progress to complete.
--graceful-decommission-timeout=GRACEFUL_DECOMMISSION_TIMEOUT- The graceful decommission timeout for decommissioning Node Managers in thecluster, used when removing nodes. Graceful decommissioning allows removingnodes from the cluster without interrupting jobs in progress. Timeout specifieshow long to wait for jobs in progress to finish before forcefully removing nodes(and potentially interrupting jobs). Timeout defaults to 0 if not set (forforceful decommission), and the maximum allowed timeout is 1 day. See $gcloud topic datetimes forinformation on duration formats.
--min-secondary-worker-fraction=MIN_SECONDARY_WORKER_FRACTION- Minimum fraction of new secondary worker nodes added in a scale up updateoperation, required to update the cluster. If it is not met, cluster updationwill rollback the addition of secondary workers. Must be a decimal value between0 and 1. Defaults to 0.0001.
--num-secondary-workers=NUM_SECONDARY_WORKERS- The new number of secondary worker nodes in the cluster.
--num-workers=NUM_WORKERS- The new number of worker nodes in the cluster.
--secondary-worker-standard-capacity-base=SECONDARY_WORKER_STANDARD_CAPACITY_BASE- The number of standard VMs in the Spot and Standard Mix feature.
--update-labels=[KEY=VALUE,…]- List of label KEY=VALUE pairs to update. If a label exists, its value ismodified. Otherwise, a new label is created.
Keys must start with a lowercase character and contain only hyphens(
-), underscores (_), lowercase characters, andnumbers. Values must contain only hyphens (-), underscores(_), lowercase characters, and numbers. - At most one of these can be specified:
- Autoscaling policy resource - The autoscaling policy to use. This represents aCloud resource. (NOTE) Some attributes are not given arguments in this group butcan be set in other ways.
To set the
projectattribute:- provide the argument
--autoscaling-policyon the command line witha fully specified name; - provide the argument
--projecton the command line; - set the property
core/project.
To set the
regionattribute:- provide the argument
--autoscaling-policyon the command line witha fully specified name; - provide the argument
--regionon the command line; - set the property
dataproc/region.
--autoscaling-policy=AUTOSCALING_POLICY- ID of the autoscaling policy or fully qualified identifier for the autoscalingpolicy.
To set the
autoscaling_policyattribute:- provide the argument
--autoscaling-policyon the command line.
- provide the argument
- provide the argument
--disable-autoscaling- Disable autoscaling, if it is enabled. This is an alias for passing the emptystring to --autoscaling-policy'.
- Autoscaling policy resource - The autoscaling policy to use. This represents aCloud resource. (NOTE) Some attributes are not given arguments in this group butcan be set in other ways.
- At most one of these can be specified:
--clear-labels- Remove all labels. If
--update-labelsis also specified then--clear-labelsis applied first.For example, to remove all labels:
gcloudalphadataprocclustersupdate--clear-labelsTo remove all existing labels and create two new labels,
andfoo:bazgcloudalphadataprocclustersupdate--clear-labels--update-labelsfoo=bar,baz=qux --remove-labels=[KEY,…]- List of label keys to remove. If a label does not exist it is silently ignored.If
--update-labelsis also specified then--update-labelsis applied first.
- At most one of these can be specified:
--delete-expiration-time=DELETE_EXPIRATION_TIME- The time when the cluster will be auto-deleted, such as"2017-08-29T18:52:51.142Z". See $gcloud topic datetimes forinformation on time formats.
--delete-max-age=DELETE_MAX_AGE- The lifespan of the cluster with auto-deletion upon completion, such as "2h" or"1d". See $gcloud topicdatetimes for information on duration formats.
--no-delete-max-age- Cancels the cluster auto-deletion by maximum cluster age (configured by--delete-max-age or --delete-expiration-time flags)
- At most one of these can be specified:
--delete-max-idle=DELETE_MAX_IDLE- The duration after the last job completes to auto-delete the cluster, such as"2h" or "1d". See $gcloud topicdatetimes for information on duration formats.
--no-delete-max-idle- Cancels the cluster auto-deletion by cluster idle duration (configured by--delete-max-idle flag)
- At most one of these can be specified:
--identity-config-file=IDENTITY_CONFIG_FILE- Path to a YAML (or JSON) file that contains the configuration forSecureMulti-Tenancy on the cluster. The path can be a Cloud Storage URL (example:'gs://path/to/file') or a local filesystem path. The mappings provided in thefile will overwrite existing mappings.
The YAML file is formatted as follows:
# Mapping header (first line) required.user_service_account_mapping:bob@company.com:service-account-bob@project.iam.gserviceaccount.comalice@company.com:service-account-alice@project.iam.gserviceaccount.com --add-user-mappings=[KEY=VALUE,…]- List of user-to-service-account mappings to add to current mappings. If amapping exists, its value is modified; otherwise, the new mapping is added.
--remove-user-mappings=[KEY,…]- List of user-to-service-account mappings to remove from the current mappings. Ifa mapping does not exist, it is ignored.
- At most one of these can be specified:
--stop-expiration-time=STOP_EXPIRATION_TIME- The time when the cluster will be auto-stopped, such as"2017-08-29T18:52:51.142Z". See $gcloud topic datetimes forinformation on time formats.
--stop-max-age=STOP_MAX_AGE- The lifespan of the cluster, with auto-stop upon completion, such as "2h" or"1d". See $gcloud topicdatetimes for information on duration formats.
--no-stop-max-age- Cancels the cluster auto-stop by maximum cluster age (configured by--stop-max-age or --stop-expiration-time flags)
- At most one of these can be specified:
--stop-max-idle=STOP_MAX_IDLE- The duration after the last job completes to auto-stop the cluster, such as "2h"or "1d". See $gcloud topicdatetimes for information on duration formats.
--no-stop-max-idle- Cancels the cluster auto-stop by cluster idle duration (configured by--stop-max-idle flag)
- GCLOUD WIDE FLAGS
- These flags are available to all commands:
--access-token-file,--account,--billing-project,--configuration,--flags-file,--flatten,--format,--help,--impersonate-service-account,--log-http,--project,--quiet,--trace-token,--user-output-enabled,--verbosity.Run
$gcloud helpfor details. - NOTES
- This command is currently in alpha and might change without notice. If thiscommand fails with API permission errors despite specifying the correct project,you might be trying to access an API with an invitation-only early accessallowlist. These variants are also available:
gclouddataprocclustersupdategcloudbetadataprocclustersupdate
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-09-03 UTC.