APIs Explorer Quickstart—Create a cluster

This page shows you how to use an inline Google APIs Explorer template to call the Cloud Dataproc API to create a cluster, then run a simple Spark job in the cluster. It also shows you how to use the APIs Explorer template to call the Cloud Dataproc API to update a cluster.

You can find out how to do the same tasks using the Google Cloud Platform Console in Quickstart Using the Console and using the command line in Quickstart using the gcloud command-line tool.

Before you begin

  1. Sign in to your Google Account.

    If you don't already have one, sign up for a new account.

  2. Select or create a GCP project.

    Go to the Project selector page

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

    Learn how to enable billing

  4. Enable the Cloud Dataproc API.

    Enable the API

Create a cluster

Before you can run Cloud Dataproc jobs, you need to create a cluster of virtual machines to run them on. To create a Cloud Dataproc cluster in your project, fill in and execute the APIs Explorer template, below, as follows:

  1. Insert your project ID (project name) in the projectID field.
  2. In the Request body config.gceClusterConfig.zoneUri field, replace the "[project-id]" placeholder with the your project ID (project name). For example, if your project ID is "my-project-12345", the completed zoneUri field would read as follows:
    https://www.googleapis.com/compute/v1/projects/my-project-12345/zones/us-central1-a
    You can also replace the us-central1-a zone with the name of another zone (see Available regions & zones). Note that the zone you choose for your cluster must be supported by the region selected for your cluster (see the next item on choosing a region). The default global region supports all zones.
  3. The following fields are filled in for you:

    1. region = global is the default. This is a special multi-region endpoint that is capable of deploying instances into any user-specified Compute Engine zone. You can also specify distinct regions, such as us-east1 or europe-west1, to isolate resources (including VM instances and Cloud Storage) and metadata storage locations utilized by Cloud Dataproc within the user-specified region. See Regional endpoints to learn more about the difference between global and regional endpoints. See Available regions & zones for information on selecting a region. You can also run the gcloud compute regions list command to see a listing of available regions.
    2. Request body clusterName = "example-cluster". This is the name of the Cloud Dataproc cluster that will be created. You will use this name to interact with your cluster, such as submitting jobs or deleting the cluster.
  4. Click EXECUTE. A dialog will ask you to confirm the default https://www.googleapis.com/auth/cloud-platform scope. Click the dialog's ALLOW to send the request to the service. After less than one second (typically), the JSON response showing that the example-cluster is pending appears below the template.

You can confirm that the cluster is created by going to GCP Console—Clusters.

Congratulations! You've used the Google APIs Explorer to create cluster.

What's next

Var denne side nyttig? Giv os en anmeldelse af den:

Send feedback om...

Cloud Dataproc Documentation
Har du brug for hjælp? Besøg vores supportside.
{"cc_re__cc_re__cc_by_4_0": ["v class=\"devsite-rating-feedback\"><button class=\"devsite-feedback-button gc-analytics-event button-white\"\n      data-category=\"Site-Wide Custom Events\" data-label=\"Send Feedback\" track-type=\"feedback\"\n      track-name=\"sendFeedbackLink\" track-metadata-position=\"rating_widget\">\n      \n      Send feedback\n  </button></div></div>\n\n\n  \n\n  \n        \n  \n\n\n\n\n\n\n\n        \n<div class=\"devsite-content-footer nocontent\">\n  \n  \n    <p>Except as otherwise noted, the content of this page is licensed under the <a href=\"https://creativecommons.org/licenses/by/4.0/\">Creative Commons Attribution 4.0 License</a>, and code samples are licensed under the <a href=\"https://www.apache.org/licenses/LICENSE-2.0\">Apache 2.0 License</a>. For details, see our <a href=\"https://developers.google.com/terms/site-policies?hl=da\">Site Policies</a>. Java is a registered trademark of Oracle and/or its affiliates.</p>\n  \n\n  \n    \n    <p class=\"devsite-content-footer-date\" itemprop=\"datePublished\"\n       content=\"2019-03-14T01:50:49.910397\">\n      \n      Sidst opdateret marts 14"]}