設定專案

本文說明如何設定 Google Cloud 專案和 Compute Engine 虛擬機器 (VM)。

設定 Google Cloud 專案

  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 Google Cloud Dataproc API.

    Enable the API

  5. Install the Google Cloud CLI.

  6. 如果您使用外部識別資訊提供者 (IdP),請先 使用聯合身分登入 gcloud CLI

  7. 如要初始化 gcloud CLI,請執行下列指令:

    gcloud init
  8. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

    Go to project selector

  9. Verify that billing is enabled for your Google Cloud project.

  10. Enable the Google Cloud Dataproc API.

    Enable the API

  11. Install the Google Cloud CLI.

  12. 如果您使用外部識別資訊提供者 (IdP),請先 使用聯合身分登入 gcloud CLI

  13. 如要初始化 gcloud CLI,請執行下列指令:

    gcloud init
  14. 您是否需要憑證?只有當您打算直接從應用程式或瀏覽器呼叫 Dataproc API 時,才需要憑證。如果您打算使用 Google Cloud 主控台或 Google Cloud CLI 建立及管理叢集,並提交工作,只需要使用 gcloud init 指令登入 SDK 即可。

    選用:設定 VM

    如果您打算從 Compute Engine 虛擬機器 (VM) 執行個體執行 gcloud CLI,則必須設定 VM,以存取 Google Cloud 服務。

    如要測試 VM 是否設定正確,請從指令列執行 gcloud compute instances describe YOUR_VM_INSTANCE_NAME。畫面上必須列出包含 https://www.googleapis.com/auth/cloud-platform 範圍的服務帳戶。如要進一步瞭解如何設定 VM,請參閱「建立使用使用者管理服務帳戶的 VM」。