设置项目

设置步骤

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

    Enable the API

  5. Install the Google Cloud CLI.
  6. To initialize the gcloud CLI, run the following command:

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

    Go to project selector

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

  9. Enable the Google Cloud Dataproc API.

    Enable the API

  10. Install the Google Cloud CLI.
  11. To initialize the gcloud CLI, run the following command:

    gcloud init

您需要凭据吗?只有当您计划从应用或浏览器直接调用 Dataproc API 时,才需要使用凭据。如果您计划使用 Google Cloud 控制台或 Google Cloud CLI 创建和管理集群以及提交作业,则只需使用 gcloud init 命令登录 SDK。

设置虚拟机(可选)

如果您计划从 Compute Engine 虚拟机 (VM) 实例运行 gcloud CLI,则必须设置虚拟机以访问 Google Cloud 服务。

如需测试您是否已正确设置虚拟机,请从命令行运行 gcloud compute instances describe your-vm-instance-name。必须列出包含 https://www.googleapis.com/auth/cloud-platform 范围。更多信息 请参阅 创建使用用户代管式服务账号的虚拟机