Sign in to your Google Cloud account. If you're new to
Google Cloud,
create an account to evaluate how our products perform in
real-world scenarios. New customers also get $300 in free credits to
run, test, and deploy workloads.
In the Google Cloud console, on the project selector page,
select or create a Google Cloud project.
Sebelum dapat menjalankan tugas Dataproc, Anda harus membuat cluster
mesin virtual untuk menjalankannya. Untuk membuat cluster Dataproc di project Anda, isi dan jalankan template Coba API ini di Google APIs Explorer.
Tentukan region
tempat cluster Anda akan berada (terima atau ganti "us-central1"). Karena Anda tidak menentukan zona dalam region di panduan memulai ini, penempatan Zona Otomatis Dataproc akan memilih zona dalam region tempat cluster akan dibuat.
Isi permintaan:
Tentukan
clusterName,
(terima atau ganti "example-cluster").
Anda akan menggunakan nama ini untuk berinteraksi dengan cluster, misalnya saat Anda
mengirimkan tugas
atau memperbarui cluster.
Klik EXECUTE. Saat pertama kali menjalankan template API, Anda mungkin diminta untuk memilih dan login ke Akun Google Anda, lalu mengizinkan Google API Explorer mengakses akun Anda. Jika permintaan berhasil, respons JSON
menunjukkan bahwa pembuatan cluster sedang menunggu.
Untuk mengonfirmasi pembuatan cluster, buka halaman Dataproc Clusters di konsol Google Cloud . Setelah penyediaan cluster selesai, status cluster akan ditampilkan sebagai "Berjalan".
Pembersihan
Agar akun Google Cloud Anda tidak dikenai biaya untuk
resource yang digunakan pada halaman ini, ikuti langkah-langkah berikut.
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Sulit dipahami","hardToUnderstand","thumb-down"],["Informasi atau kode contoh salah","incorrectInformationOrSampleCode","thumb-down"],["Informasi/contoh yang saya butuhkan tidak ada","missingTheInformationSamplesINeed","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 2025-08-22 UTC."],[[["\u003cp\u003eThis guide demonstrates how to create a Dataproc cluster using an inline Google APIs Explorer template to interact with the Dataproc API.\u003c/p\u003e\n"],["\u003cp\u003eBefore running Dataproc jobs, a cluster of virtual machines must be created using the provided Google APIs Explorer template, which requires your project ID and a specified region.\u003c/p\u003e\n"],["\u003cp\u003eWhen creating a cluster, users must input their project ID, choose a cluster region, and assign a cluster name, with options to accept or alter pre-filled values.\u003c/p\u003e\n"],["\u003cp\u003eAfter cluster creation, you can verify its status as "Running" on the Dataproc Clusters page in the Google Cloud console, and if no longer needed, the cluster should be deleted to avoid charges.\u003c/p\u003e\n"],["\u003cp\u003eAlternative ways to create a cluster exist, such as using the Google Cloud console, the Google Cloud CLI, or client libraries, and these are also options for removing the cluster.\u003c/p\u003e\n"]]],[],null,["# Quickstart: Create a Dataproc cluster by using a template\n\nCreate a Dataproc cluster by using a template\n=============================================\n\nThis page shows you how to use an inline\n[Google APIs Explorer](https://developers.google.com/apis-explorer/#p/)\ntemplate to call the Dataproc API to create a Dataproc cluster.\n\nFor other ways to create a cluster, see:\n\n- [Create a Dataproc cluster by using the Google Cloud console](/dataproc/docs/quickstarts/create-cluster-console#create_a_cluster)\n- [Create a Dataproc cluster by using the Google Cloud CLI](/dataproc/docs/quickstarts/create-cluster-gcloud#create_a_cluster)\n- [Create a Dataproc cluster by using client libraries](/dataproc/docs/quickstarts/create-cluster-client-libraries)\n\nBefore you begin\n----------------\n\n- Sign in to your Google Cloud account. If you're new to Google Cloud, [create an account](https://console.cloud.google.com/freetrial) to evaluate how our products perform in real-world scenarios. New customers also get $300 in free credits to run, test, and deploy workloads.\n- In the Google Cloud console, on the project selector page,\n select or create a Google Cloud project.\n\n | **Note**: If you don't plan to keep the resources that you create in this procedure, create a project instead of selecting an existing project. After you finish these steps, you can delete the project, removing all resources associated with the project.\n\n [Go to project selector](https://console.cloud.google.com/projectselector2/home/dashboard)\n-\n [Verify that billing is enabled for your Google Cloud project](/billing/docs/how-to/verify-billing-enabled#confirm_billing_is_enabled_on_a_project).\n\n-\n\n\n Enable the Dataproc API.\n\n\n [Enable the API](https://console.cloud.google.com/flows/enableapi?apiid=dataproc&redirect=https://console.cloud.google.com)\n\n- In the Google Cloud console, on the project selector page,\n select or create a Google Cloud project.\n\n | **Note**: If you don't plan to keep the resources that you create in this procedure, create a project instead of selecting an existing project. After you finish these steps, you can delete the project, removing all resources associated with the project.\n\n [Go to project selector](https://console.cloud.google.com/projectselector2/home/dashboard)\n-\n [Verify that billing is enabled for your Google Cloud project](/billing/docs/how-to/verify-billing-enabled#confirm_billing_is_enabled_on_a_project).\n\n-\n\n\n Enable the Dataproc API.\n\n\n [Enable the API](https://console.cloud.google.com/flows/enableapi?apiid=dataproc&redirect=https://console.cloud.google.com)\n\n\u003cbr /\u003e\n\nCreate a cluster\n----------------\n\nBefore you can run Dataproc jobs, you need to create a cluster\nof virtual machines to run them on. To create a Dataproc cluster\nin your project, fill in and execute the Google APIs Explorer **Try this API**\ntemplate.\n| **Note:** The `region` and `clusterName` parameter values are filled in for you. Accept or replace these \"seeded\" parameter values.\n\n1. **Request parameters:**\n\n 1. Insert your [**projectId**](https://console.cloud.google.com/).\n 2. Specify the [**region**](/compute/docs/regions-zones/regions-zones#available) where your cluster will be located (accept or replace \"us-central1\"). Since you are not specifying a zone within the region in this quickstart, [Dataproc Auto Zone placement](/dataproc/docs/concepts/configuring-clusters/auto-zone) will pick a zone within the region where it will create the cluster.\n2. **Request body:**\n\n 1. Specify a [**clusterName**](/dataproc/docs/reference/rest/v1/projects.regions.clusters#Cluster.FIELDS.cluster_name), (accept or replace \"example-cluster\"). You will use this name to interact with your cluster, for example when you [submit jobs](/dataproc/docs/quickstarts/submit-spark-job-template) or [update the cluster](/dataproc/docs/quickstarts/update-cluster-template).\n3. Click **EXECUTE**. The first time you\n run the API template, you may be asked to choose and sign into\n your Google account, then authorize the Google APIs Explorer to access your\n account. If the request is successful, the JSON response\n shows that cluster creation is pending.\n\n4. To confirm cluster creation, open the\n [Dataproc Clusters](https://console.cloud.google.com/dataproc/clusters)\n page in the Google Cloud console. After cluster provisioning completes,\n the cluster's status will show as \"Running\".\n\n\nClean up\n--------\n\n\nTo avoid incurring charges to your Google Cloud account for\nthe resources used on this page, follow these steps.\n\n\u003cbr /\u003e\n\n1. If you don't need the cluster to explore the other quickstarts or to run other jobs, use the [APIs Explorer](/dataproc/docs/quickstarts/quickstart-explorer-delete), the [Google Cloud console](/dataproc/docs/quickstarts/create-cluster-console#clean-up), the gcloud CLI [gcloud](/dataproc/docs/quickstarts/create-cluster-gcloud#clean-up) command-line tool, or the [Cloud Client Libraries](/dataproc/docs/quickstarts/create-cluster-client-libraries) to delete the cluster.\n\nWhat's next\n-----------\n\n- Learn how to [submit a Spark job by using a template](/dataproc/docs/quickstarts/submit-spark-job-template)."]]