使用範本建立 Dataproc 叢集

本頁說明如何使用內嵌 Google APIs Explorer 範本呼叫 Dataproc API,建立 Dataproc 叢集。

如要瞭解其他叢集建立方式,請參閱:

事前準備

  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. Verify 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. Verify that billing is enabled for your Google Cloud project.

  7. Enable the Dataproc API.

    Enable the API

  8. 建立叢集

    執行 Dataproc 工作之前,您必須先建立要用來執行工作的虛擬機器叢集。如要在專案中建立 Dataproc 叢集,請填寫並執行 Google APIs Explorer Try this API 範本。

    1. 要求參數:

      1. 插入 projectId
      2. 指定叢集所在的區域 (接受或取代「us-central1」)。由於您在本快速入門中未指定地區內的區域,Dataproc 自動選擇區域位置會選擇地區內的區域,並在該區域中建立叢集。
    2. 要求主體:

      1. 指定 clusterName (接受或取代「example-cluster」)。您將使用此名稱與叢集互動,例如提交工作更新叢集
    3. 按一下「執行」EXECUTE。首次執行 API 範本時,系統可能會要求您選擇並登入 Google 帳戶,然後授權 Google APIs Explorer 存取您的帳戶。如果要求成功,JSON 回應會顯示叢集建立作業待處理。

    4. 如要確認叢集已建立,請在 Google Cloud 控制台中開啟「Dataproc Clusters」(Dataproc 叢集)頁面。叢集佈建完成後,叢集狀態會顯示為「執行中」。

    清除所用資源

    如要避免系統向您的 Google Cloud 帳戶收取本頁所用資源的費用,請按照下列步驟操作。

    1. 如果您不需要叢集來探索其他快速入門導覽課程或執行其他工作,請使用 APIs ExplorerGoogle Cloud 主控台、gcloud CLI gcloud 指令列工具或 Cloud 用戶端程式庫刪除叢集。

    後續步驟