テンプレートを使用してクラスタを作成する

このページでは、インラインの Google API Explorer テンプレートを使用して、Managed Service for Apache Spark クラスタを作成する方法について説明します。

他の方法でクラスタを作成するには、次に挙げるページをご覧ください。

始める前に

  1. アカウントにログインします。 Google Cloud を初めて使用する場合は、 アカウントを作成して、実際のシナリオで Google プロダクトのパフォーマンスを評価してください。 Google Cloud新規のお客様には、ワークロードの実行、テスト、デプロイができる無料クレジット $300 分を差し上げます。
  2. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

    Roles required to select or create a project

    • Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
    • Create a project: To create a project, you need the Project Creator role (roles/resourcemanager.projectCreator), which contains the resourcemanager.projects.create permission. Learn how to grant roles.

    Go to project selector

  3. Verify that you have the permissions required to complete this guide.

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

  5. Enable the Dataproc API.

    Roles required to enable APIs

    To enable APIs, you need the Service Usage Admin IAM role (roles/serviceusage.serviceUsageAdmin), which contains the serviceusage.services.enable permission. Learn how to grant roles.

    Enable the API

  6. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

    Roles required to select or create a project

    • Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
    • Create a project: To create a project, you need the Project Creator role (roles/resourcemanager.projectCreator), which contains the resourcemanager.projects.create permission. Learn how to grant roles.

    Go to project selector

  7. Verify that you have the permissions required to complete this guide.

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

  9. Enable the Dataproc API.

    Roles required to enable APIs

    To enable APIs, you need the Service Usage Admin IAM role (roles/serviceusage.serviceUsageAdmin), which contains the serviceusage.services.enable permission. Learn how to grant roles.

    Enable the API

必要なロール

このページの例を実行するには、特定の IAM ロールが必要です。組織のポリシーによっては、これらのロールがすでに付与されている場合があります。ロールの付与を確認するには、 ロールを付与する必要がありますか?をご覧ください。

ロールの付与については、 プロジェクト、フォルダ、組織へのアクセス権の管理をご覧ください。

ユーザーロール

Managed Service for Apache Spark クラスタを作成するために必要な権限を取得するには、次の IAM ロールを付与するよう管理者に依頼してください。

サービス アカウント ロール

Compute Engine のデフォルトのサービス アカウントに、Managed Service for Apache Spark クラスタを作成するために必要な 権限を付与するには、 プロジェクトに対する Dataproc ワーカー roles/dataproc.worker) IAM ロールを Compute Engine のデフォルトのサービス アカウントに付与するよう管理者に依頼してください。

クラスタの作成

Managed Service for Apache Spark ジョブを実行する前に、ジョブを実行する仮想マシンのクラスタを作成する必要があります。プロジェクトに Managed Service for Apache Spark クラスタを作成するには、このページの Google API Explorer の [Try this Method] テンプレートに入力して実行します(テンプレートに移動するには、スクロールするか [使ってみる] をクリックします)。

  1. リクエスト パラメータ:

    1. プロジェクト ID を挿入します。
    2. 実際のクラスタが配置されている [region]を指定します(「us-central1」を必要に応じて置き換えます)。このクイックスタートでは、リージョン内のゾーンを指定していないため、 Managed Service for Apache Spark の自動ゾーン プレースメント によって、クラスタを作成するリージョン内のゾーンが選択されます。
  2. リクエストの本文:

    1. [clusterName] を指定します(「example-cluster」を必要に応じて置き換えます)。ジョブの送信クラスタの更新など、クラスタの操作にはこの名前を使用します。
  3. [EXECUTE] をクリックします。API テンプレートを初めて実行する場合、Google アカウントを選択してログインし、Google API Explorer からアカウントへのアクセスを承認するように求められます。リクエストが成功すると、JSON のレスポンスで、クラスタの作成が保留中であることが示されます。

  4. クラスタが作成されたことを確認するには、 [Managed Service for Apache Spark クラスタ] ページを Google Cloud コンソールで開きます。クラスタのプロビジョニングが完了すると、クラスタの [ステータス] には「実行中」と表示されます。

クリーンアップ

このページで使用したリソースについて、 Google Cloud アカウントに課金されないようにするには、 次の手順を実施します。

  1. 他のクイックスタートの確認や、他のジョブを実行するためのクラスタが必要ない場合は、API ExplorerGoogle Cloud コンソール、gcloud CLI の gcloud コマンドライン ツール、または Cloud クライアント ライブラリを使用したクイックスタートを使用してクラスタを削除できます。

次のステップ