Dataproc Metastore API を使用する代わりに、Google Cloud CLI の gcloud metastore コマンドを使用して Dataproc Metastore サービスを管理、アクセスすることもできます。
このページでは、Google Cloud CLI の使用を開始する方法について説明します。これにより、Cloud SDK を使用して Dataproc Metastore と情報のやりとりができます。
始める前に
- アカウントにログインします。 Google Cloud を初めて使用する場合は、 アカウントを作成して、 実際のシナリオでプロダクトがどのように機能するかを評価してください。 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.
Enable the Dataproc Metastore 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.-
Google Cloud CLI をインストールします。
-
外部 ID プロバイダ(IdP)を使用している場合は、まず連携 ID を使用して gcloud CLI にログインする必要があります。
-
gcloud CLI を初期化するには、次のコマンドを実行します:
gcloud init -
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.
Enable the Dataproc Metastore 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.-
Google Cloud CLI をインストールします。
-
外部 ID プロバイダ(IdP)を使用している場合は、まず連携 ID を使用して gcloud CLI にログインする必要があります。
-
gcloud CLI を初期化するには、次のコマンドを実行します:
gcloud init
Google Cloud CLI のスタートガイド
gcloud CLI を使用するにあたっては、Google Cloud CLI のドキュメントをご覧ください。--help フラグを使用すると、ツール、リソース、コマンドについてのヘルプを表示できます。
gcloud metastore --help
Google Cloud CLI リファレンスでも --help フラグで表示できます。
ローカル クライアントでデフォルト構成のプロパティを設定する
ほとんどの gcloud metastore コマンドでは、--location フラグを使用するか、デフォルトのロケーションを設定することで指定するロケーションが必要です。また、Dataproc Metastore サービスのためにデフォルトのプロジェクトと階層を設定することもできます。
- デフォルトのプロジェクトを設定するには、次のコマンドを実行します。
gcloud config set project PROJECT_ID
ここで、PROJECT_ID は、 Google Cloud プロジェクトが属する Dataproc Metastore サービスの ID です。
- Dataproc Metastore のロケーションを構成するには、次のコマンドを実行します。
gcloud config set metastore/location LOCATION
ここで、LOCATION は、
us-central1などのサポートされているリージョンです。 - Dataproc Metastore 階層を構成するには、次のコマンドを実行します。
gcloud config set metastore/tier TIER
ここで、TIER には、新しいサービスの容量を設定します。
- 省略可: gcloud CLI の構成を一覧表示するには、次のコマンドを実行します。
gcloud config list