使用範本建立 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. 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

建立叢集

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

  1. 要求參數:

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

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

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

清除所用資源

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

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

後續步驟