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

  1. 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.
  2. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

    Go to project selector

  3. Make sure that billing is enabled for your Google Cloud project.

  4. Enable the Dataproc API.

    Enable the API

  5. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

    Go to project selector

  6. Make sure that billing is enabled for your Google Cloud project.

  7. Enable the Dataproc API.

    Enable the 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.

  1. Request parameters:

    1. Insert your projectId.
    2. 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.
  2. Request body:

    1. 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.
  3. 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.

  4. 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.

  1. 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