Mantenha tudo organizado com as coleções
Salve e categorize o conteúdo com base nas suas preferências.
Para reduzir os efeitos da indisponibilidade de VMs especificadas pelo usuário em regiões e horários específicos (falta de estoque), o Dataproc permite solicitar a criação de um partial cluster especificando um número mínimo de workers principais aceitável para permitir a criação do cluster.
Cluster padrão
Cluster parcial
Se um ou mais workers principais não puderem ser criados e inicializados,
a criação do cluster vai falhar. Os workers criados continuam sendo executados e
gerando cobranças até serem excluídos pelo usuário.
Se o número mínimo especificado de workers puder ser criado, o cluster será criado. Os workers com falha (não inicializados) são excluídos e não geram cobranças. Se o número mínimo especificado de workers não puder ser
criado e inicializado, o cluster não será criado. Os workers criados não são excluídos para permitir a depuração.
O tempo de criação do cluster é otimizado.
O tempo de criação do cluster pode ser maior, já que todos os nós precisam informar o status
de provisionamento.
Use o escalonamento automático
com a criação parcial de clusters para garantir que o número desejado (total)
de workers principais seja criado. O escalonamento automático tentará adquirir workers com falha
em segundo plano se a carga de trabalho exigir.
Confira a seguir um exemplo de política de escalonamento automático que tenta novamente até que o número total
de instâncias de worker principal atinja um tamanho de destino de 10.
Os campos minInstances e maxInstances da política correspondem ao número mínimo e total de workers principais especificados no momento da criação do cluster (consulte Criar um cluster parcial).
Definir scaleDownFactor como 0 impede que o cluster seja reduzido de 10 para 8 e ajuda a manter o número de workers no limite máximo de 10.
É possível usar a CLI do Google Cloud ou a API Dataproc para
criar um cluster parcial do Dataproc.
gcloud
Para criar um cluster parcial do Dataproc na linha de comando, execute o
comando gcloud dataproc clusters create
a seguir localmente em uma janela de terminal ou no
Cloud Shell.
CLUSTER_NAME: o nome do cluster precisa começar com uma letra minúscula
seguida por até 51 letras minúsculas, números e hifens, e não pode terminar com um hífen.
PROJECT: especifique o projeto associado ao cluster de jobs.
NUM_WORKERS: o número total de workers principais no cluster a
ser criado, se disponível.
MIN_NUM_WORKERS: o número mínimo de workers principais a serem criados
se o número total especificado de workers (NUM_WORKERS) não puder ser criado.
A criação do cluster falha se esse número mínimo de workers principais não puder ser criado. Os workers criados não são excluídos para permitir a depuração.
Se essa flag for omitida, será tentada a criação de um cluster padrão com o número total de
workers principais (NUM_WORKERS).
REST
Para criar um cluster parcial do Dataproc, especifique o número mínimo de workers principais no campo workerConfig.minNumInstances como parte de uma solicitação clusters.create.
Mostrar o número de workers provisionados
Depois de criar um cluster, execute o seguinte comando da CLI gcloud
para listar o número de workers, incluindo os secundários,
provisionados no cluster.
gcloud dataproc clusters list \
--project=PROJECT \
--region=REGION \
--filter=clusterName=CLUSTER_NAME
[[["Fácil de entender","easyToUnderstand","thumb-up"],["Meu problema foi resolvido","solvedMyProblem","thumb-up"],["Outro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Informações incorretas ou exemplo de código","incorrectInformationOrSampleCode","thumb-down"],["Não contém as informações/amostras de que eu preciso","missingTheInformationSamplesINeed","thumb-down"],["Problema na tradução","translationIssue","thumb-down"],["Outro","otherDown","thumb-down"]],["Última atualização 2025-09-04 UTC."],[[["\u003cp\u003eDataproc's partial cluster creation feature allows cluster creation to proceed even if the desired number of primary worker VMs are unavailable, as long as a specified minimum number can be provisioned.\u003c/p\u003e\n"],["\u003cp\u003eUnlike standard clusters, partial clusters will continue creation if the minimum number of primary workers is met, but failed workers are deleted and not charged for, and single node clusters are not allowed.\u003c/p\u003e\n"],["\u003cp\u003eAutoscaling can be used with partial cluster creation to dynamically acquire any failed worker nodes in the background, working to ensure the full target number of primary workers are present over time.\u003c/p\u003e\n"],["\u003cp\u003ePartial clusters can be created using the Google Cloud CLI or the Dataproc API by specifying the minimum number of workers, but are not supported through the Google Cloud console.\u003c/p\u003e\n"],["\u003cp\u003eAfter cluster creation, users can check the number of provisioned workers, including secondary workers, using the \u003ccode\u003egcloud dataproc clusters list\u003c/code\u003e command.\u003c/p\u003e\n"]]],[],null,["To mitigate the effects of the unavailability of user-specified VMs in specific\nregions at specific times\n([stockouts](https://en.wikipedia.org/wiki/Stockout)),\nDataproc lets you request the creation of a `partial cluster` by specifying\na **minimum number** of primary workers that is acceptable to allow cluster creation.\n| **Note:** See [Dataproc secondary workers](/dataproc/docs/concepts/compute/secondary-vms) to understand the difference between primary and secondary workers.\n\n| Standard cluster | Partial cluster |\n|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| If one or more primary workers cannot be created and initialized, cluster creation fails. Workers that are created continue to run and incur charges until deleted by the user. | If the specified minimum number of workers can be created, the cluster is created. Failed (uninitialized) workers are deleted and don't incur charges. If the specified minimum number of workers can't be created and initialized, the cluster is not created. Workers that are created aren't deleted to allow for debugging. |\n| Cluster creation time is optimized. | Longer cluster creation time can occur since all nodes must report provisioning status. |\n| [Single node clusters](/dataproc/docs/concepts/configuring-clusters/single-node-clusters) are available for creation. | [Single node clusters](/dataproc/docs/concepts/configuring-clusters/single-node-clusters) are not available for creation. |\n\nAutoscaling\n\nUse [autoscaling](/dataproc/docs/concepts/configuring-clusters/autoscaling)\nwith partial cluster creation to make sure that the target (full) number\nof primary workers is created. Autoscaling will try to acquire failed workers\nin the background if the workload requires them.\n\nThe following is a sample autoscaling policy that retries until the total number\nof primary worker instances reaches a target size of 10.\nThe policy's `minInstances` and `maxInstances` match the minimum and total\nnumber of primary workers specified at cluster creation time (see\n[Create a partial cluster](#create-partial-cluster)).\nSetting the `scaleDownFactor` to 0 prevents the cluster from scaling down\nfrom 10 to 8, and will help keep the number of workers at the maximum 10-worker\nlimit. \n\n workerConfig:\n minInstances: 8\n maxInstances: 10\n basicAlgorithm:\n cooldownPeriod: 2m\n yarnConfig:\n scaleUpFactor: 1\n scaleDownFactor: 0\n gracefulDecommissionTimeout: 1h\n\nCreate a partial cluster\n\nYou can use the Google Cloud CLI or the Dataproc API to\ncreate a Dataproc partial cluster.\n**Note:** Dataproc partial cluster creation is not available in the Google Cloud console. \n\ngcloud\n\nTo create a Dataproc partial cluster on the command line, run the\nfollowing [`gcloud dataproc clusters create`](/sdk/gcloud/reference/dataproc/clusters/create#--min-num-workers)\ncommand locally in a terminal window or in\n[Cloud Shell](https://console.cloud.google.com/?cloudshell=true). \n\n```\ngcloud dataproc clusters create CLUSTER_NAME \\\n --project=PROJECT \\\n --region=REGION \\\n --num-workers=NUM_WORKERS \\\n --min-num-workers=MIN_NUM_WORKERS \\\n other args ...\n```\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003eCLUSTER_NAME\u003c/var\u003e: The cluster name must start with a lowercase letter followed by up to 51 lowercase letters, numbers, and hyphens, and cannot end with a hyphen.\n- \u003cvar translate=\"no\"\u003ePROJECT\u003c/var\u003e: Specify the project associated with the job cluster.\n- \u003cvar translate=\"no\"\u003eREGION\u003c/var\u003e: Specify the [Compute Engine region](/compute/docs/regions-zones#available) where the job cluster will be located.\n- \u003cvar translate=\"no\"\u003eNUM_WORKERS\u003c/var\u003e: The total number of primary workers in the cluster to create if available.\n- \u003cvar translate=\"no\"\u003eMIN_NUM_WORKERS\u003c/var\u003e: The minimum number of primary workers to create if the specified total number of workers (`NUM_WORKERS`) cannot be created. Cluster creation fails if this minimum number of primary workers cannot be created (workers that are created are not deleted to allow for debugging). If this flag is omitted, standard cluster creation with the total number of primary workers (`NUM_WORKERS`) is attempted.\n\nREST\n\nTo create a Dataproc partial cluster, specify the minimum number of primary workers in the\n[`workerConfig.minNumInstances`](/dataproc/docs/reference/rest/v1/InstanceGroupConfig#FIELDS.min_num_instances)\nfield as part of a [clusters.create](/dataproc/docs/reference/rest/v1/projects.regions.clusters/create) request.\n| **Note:** You can click the **Equivalent REST\n| or command line** links at the bottom of the left panel of the Dataproc Google Cloud console [Create a cluster](https://console.cloud.google.com/dataproc/clustersAdd) page to have the Console construct an equivalent API REST request or gcloud CLI command to use in your code or from the command line to create a cluster.\n\n\u003cbr /\u003e\n\nDisplay the number of provisioned workers\n\nAfter creating a cluster, you can run the following gcloud CLI\ncommand to list the number of workers, including any secondary workers,\nprovisioned in your cluster. \n\n```\ngcloud dataproc clusters list \\\n --project=PROJECT \\\n --region=REGION \\\n --filter=clusterName=CLUSTER_NAME\n```"]]