テンプレートを使用してクラスタを作成する
このページでは、インラインの Google API Explorer テンプレートを使用して、Managed Service for Apache Spark クラスタを作成する方法について説明します。
他の方法でクラスタを作成するには、次に挙げるページをご覧ください。
始める前に
- アカウントにログインします。 Google Cloud を初めて使用する場合は、 アカウントを作成して、実際のシナリオで Google プロダクトのパフォーマンスを評価してください。 Google Cloud新規のお客様には、ワークロードの実行、テスト、デプロイができる無料クレジット $300 分を差し上げます。
-
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 theresourcemanager.projects.createpermission. Learn how to grant roles.
-
Verify that you have the permissions required to complete this guide.
-
Verify that billing is enabled for your Google Cloud project.
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 theserviceusage.services.enablepermission. Learn how to grant roles.-
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 theresourcemanager.projects.createpermission. Learn how to grant roles.
-
Verify that you have the permissions required to complete this guide.
-
Verify that billing is enabled for your Google Cloud project.
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 theserviceusage.services.enablepermission. Learn how to grant roles.
必要なロール
このページの例を実行するには、特定の IAM ロールが必要です。組織のポリシーによっては、これらのロールがすでに付与されている場合があります。ロールの付与を確認するには、 ロールを付与する必要がありますか?をご覧ください。
ロールの付与については、 プロジェクト、フォルダ、組織へのアクセス権の管理をご覧ください。
ユーザーロール
Managed Service for Apache Spark クラスタを作成するために必要な権限を取得するには、次の IAM ロールを付与するよう管理者に依頼してください。
-
Dataproc 編集者 (
roles/dataproc.editor)プロジェクトに対する -
Compute Engine のデフォルトのサービス アカウントに対するサービス アカウント ユーザー (
roles/iam.serviceAccountUser)
サービス アカウント ロール
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] テンプレートに入力して実行します(テンプレートに移動するには、スクロールするか [使ってみる] をクリックします)。
リクエスト パラメータ:
- プロジェクト ID を挿入します。
- 実際のクラスタが配置されている [region]を指定します(「us-central1」を必要に応じて置き換えます)。このクイックスタートでは、リージョン内のゾーンを指定していないため、 Managed Service for Apache Spark の自動ゾーン プレースメント によって、クラスタを作成するリージョン内のゾーンが選択されます。
リクエストの本文:
- [clusterName] を指定します(「example-cluster」を必要に応じて置き換えます)。ジョブの送信やクラスタの更新など、クラスタの操作にはこの名前を使用します。
[EXECUTE] をクリックします。API テンプレートを初めて実行する場合、Google アカウントを選択してログインし、Google API Explorer からアカウントへのアクセスを承認するように求められます。リクエストが成功すると、JSON のレスポンスで、クラスタの作成が保留中であることが示されます。
クラスタが作成されたことを確認するには、 [Managed Service for Apache Spark クラスタ] ページを Google Cloud コンソールで開きます。クラスタのプロビジョニングが完了すると、クラスタの [ステータス] には「実行中」と表示されます。
クリーンアップ
このページで使用したリソースについて、 Google Cloud アカウントに課金されないようにするには、 次の手順を実施します。
- 他のクイックスタートの確認や、他のジョブを実行するためのクラスタが必要ない場合は、API Explorer、Google Cloud コンソール、gcloud CLI の gcloud コマンドライン ツール、または Cloud クライアント ライブラリを使用したクイックスタートを使用してクラスタを削除できます。
次のステップ
- テンプレートを使用して Spark ジョブを送信する方法を学習する。