Create a Dataproc cluster by using a template
This page shows you how to use an inline Google APIs Explorer template to call the Dataproc API to create a Dataproc cluster.
For other ways to create a cluster, see:
Before you begin
- 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.
-
Make sure that billing is enabled for your Google Cloud project.
-
Enable the Dataproc API.
-
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
-
Make sure that billing is enabled for your Google Cloud project.
-
Enable the Dataproc API.
Create a cluster
Before you can run Dataproc jobs, you need to create a cluster of virtual machines to run them on. To create a Dataproc cluster in your project, fill in and execute the Google APIs Explorer Try this API template.
Request parameters:
- Insert your projectId.
- Specify the region 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 will pick a zone within the region where it will create the cluster.
Request body:
- Specify a clusterName, (accept or replace "example-cluster"). You will use this name to interact with your cluster, for example when you submit jobs or update the cluster.
Click EXECUTE. The first time you run the API template, you may be asked to choose and sign into your Google account, then authorize the Google APIs Explorer to access your account. If the request is successful, the JSON response shows that cluster creation is pending.
To confirm cluster creation, open the Dataproc Clusters page in the Google Cloud console. After cluster provisioning completes, the cluster's status will show as "Running".
Clean up
To avoid incurring charges to your Google Cloud account for the resources used on this page, follow these steps.
- If you don't need the cluster to explore the other quickstarts or to run other jobs, use the APIs Explorer, the Google Cloud console, the gcloud CLI gcloud command-line tool, or the Cloud Client Libraries to delete the cluster.
What's next
- Learn how to submit a Spark job by using a template.