관리되는 클러스터에서 워크플로를 실행하는 대신 클러스터 선택기를 사용하여 워크플로에 기존 클러스터를 선택할 수 있습니다. 워크플로가 끝나면 선택한 클러스터가 삭제되지 않습니다.
선택기는 하나 이상의 Dataproc 사용자 라벨을 지정합니다.
라벨이 모든 선택기 라벨과 일치하는 워크플로와 동일한 리전에 있는 클러스터는 워크플로 작업을 실행할 수 있습니다. 여러 클러스터가 선택기와 일치하면 Dataproc은 여유 YARN 메모리가 가장 많은 클러스터를 선택합니다.
템플릿에 클러스터 선택기 추가
Google Cloud CLI 또는 Dataproc API를 사용하여 워크플로 템플릿에 클러스터 선택기를 추가할 수 있습니다.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-08-27(UTC)"],[[["\u003cp\u003eCluster selectors allow workflows to run on existing clusters instead of managed clusters, and the selected cluster is not deleted post-workflow.\u003c/p\u003e\n"],["\u003cp\u003eSelectors use Dataproc user labels to identify eligible clusters within the same region as the workflow, and Dataproc chooses the cluster with the most free YARN memory if multiple clusters match.\u003c/p\u003e\n"],["\u003cp\u003eYou can add a cluster selector to a workflow template using either the Google Cloud CLI or the Dataproc API, with options to set specific cluster labels.\u003c/p\u003e\n"],["\u003cp\u003eAutomatically-applied cluster labels like \u003ccode\u003egoog-dataproc-cluster-name\u003c/code\u003e and \u003ccode\u003egoog-dataproc-cluster-uuid\u003c/code\u003e can be used to point a cluster selector to an existing cluster.\u003c/p\u003e\n"],["\u003cp\u003eClusters with matching labels can be used to create cluster pools, and the workflow template can select a cluster within that pool based on the applied labels.\u003c/p\u003e\n"]]],[],null,["As an alternative to running a workflow on a\n[managed cluster](/dataproc/docs/concepts/workflows/using-workflows#configuring_or_selecting_a_cluster), you can use a\ncluster selector to choose an existing cluster for your workflow. At the\nconclusion of the workflow, the selected cluster is not deleted.\n\nSelectors specify one or more\n[Dataproc user labels](/dataproc/docs/concepts/labels).\nClusters in same\n[region](/compute/docs/regions-zones#available) as the workflow whose labels\nmatch all of the selector labels are eligible to run workflow jobs. If multiple\nclusters match the selector, Dataproc will\nchoose the cluster with the most free YARN memory.\n\nAdd a cluster selector to a template\n\nYou can add a cluster selector to a workflow template using the\nGoogle Cloud CLI or the Dataproc API. \n\ngcloud command \n\n```\ngcloud dataproc workflow-templates set-cluster-selector template-id \\\n --region=region \\\n --cluster-labels=name=value[[,name=value]...]\n```\n\nREST API See [WorkflowTemplatePlacement.ClusterSelector](/dataproc/docs/reference/rest/v1/projects.locations.workflowTemplates#clusterselector). This field is provided as part of a completed [WorkflowTemplate](/dataproc/docs/reference/rest/v1/projects.regions.workflowTemplates#resource-workflowtemplate) submitted with a [workflowTemplates.create](/dataproc/docs/reference/rest/v1/projects.regions.workflowTemplates/create) or [workflowTemplates.update](/dataproc/docs/reference/rest/v1/projects.regions.workflowTemplates/update) request.\n\nConsole\n\nYou can view existing workflow templates and instantiated workflows from\nthe Dataproc\n[**Workflows**](https://console.cloud.google.com/dataproc/workflows/instances) page in Google Cloud console.\n\nUse automatically applied labels\n\nYou can point a cluster selector to an existing cluster by using\none of the following [automatically-applied cluster labels](/dataproc/docs/concepts/labels#automatically-applied_labels):\n\n- `goog-dataproc-cluster-name`\n- `goog-dataproc-cluster-uuid`\n\n**Example:** \n\n```\ngcloud dataproc workflow-templates set-cluster-selector template-id \\\n --region=region \\\n --cluster-labels=goog-dataproc-cluster-name=my-cluster\n```\n\n\u003cbr /\u003e\n\nSelect from a cluster pool\n\nYou can let Dataproc choose a cluster from a pool of clusters.\nThe cluster pools can be defined with labels.\n\n**Example:** \n\n```\ngcloud dataproc clusters create cluster-1 --labels cluster-pool=pool-1 \\\n --region=\u003cvar translate=\"no\"\u003eregion\u003c/var\u003e\ngcloud dataproc clusters create cluster-2 --labels cluster-pool=pool-1 \\\n --region=\u003cvar translate=\"no\"\u003eregion\u003c/var\u003e\ngcloud dataproc clusters create cluster-3 --labels cluster-pool=pool-2 \\\n --region=\u003cvar translate=\"no\"\u003eregion\u003c/var\u003e\n```\n\nAfter cluster creation ... \n\n```\ngcloud dataproc workflow-templates create my-template \\\n --region=\u003cvar translate=\"no\"\u003eregion\u003c/var\u003e\ngcloud dataproc workflow-templates set-cluster-selector my-template \\\n --region=\u003cvar translate=\"no\"\u003eregion\u003c/var\u003e \\\n --cluster-labels=cluster-pool=pool-1\n```\n\nThe workflow will be run on either cluster-1 or cluster-2, but not on cluster-3."]]