Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
Alternativ zu den Dataproc Metastore APIs können Sie mit den gcloud metastore-Befehlen der Google Cloud CLI die Dataproc Metastore-Dienste verwalten und auf diese zugreifen.
Auf dieser Seite wird beschrieben, wie Sie die Google Cloud CLI verwenden, um mit Dataproc Metastore zu interagieren.
Hinweise
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.
In the Google Cloud console, on the project selector page,
select or create a Google Cloud project.
Führen Sie folgenden Befehl aus, um die gcloud CLI zu initialisieren:
gcloudinit
Erste Schritte mit der Google Cloud CLI
Lesen Sie die Dokumentation zur Google Cloud CLI, um mit der gcloud CLI zu beginnen.
Mit dem Flag --help können Sie Hilfe für das Tool, Ressourcen und Befehle anfordern:
Standardkonfigurationseigenschaften im lokalen Client festlegen
Für die meisten gcloud metastore-Befehle ist ein Speicherort erforderlich, den Sie mit dem Flag --location oder durch Festlegen des Standardspeicherorts angeben. Sie können auch das Standardprojekt und die Standardstufe für Ihre Dataproc Metastore-Dienste festlegen.
Führen Sie den folgenden Befehl aus, um das Standardprojekt festzulegen:
gcloud config set project PROJECT_ID
Dabei ist PROJECT_ID die ID des Google Cloud Projekts, zu dem der Dataproc Metastore-Dienst gehört.
Führen Sie den folgenden Befehl aus, um den Dataproc Metastore-Standort zu konfigurieren:
gcloud config set metastore/location LOCATION
Dabei ist LOCATION eine unterstützte Region wie us-central1.
Führen Sie den folgenden Befehl aus, um die Dataproc Metastore-Stufe zu konfigurieren:
gcloud config set metastore/tier TIER
Dabei wird mit TIER die Kapazität des neuen Dienstes festgelegt.
Optional: Führen Sie den folgenden Befehl aus, um die Konfiguration für die gcloud CLI aufzulisten:
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Schwer verständlich","hardToUnderstand","thumb-down"],["Informationen oder Beispielcode falsch","incorrectInformationOrSampleCode","thumb-down"],["Benötigte Informationen/Beispiele nicht gefunden","missingTheInformationSamplesINeed","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 2025-08-27 (UTC)."],[[["\u003cp\u003eThe Google Cloud CLI can be used as an alternative to the Dataproc Metastore APIs for managing and accessing Dataproc Metastore services.\u003c/p\u003e\n"],["\u003cp\u003eYou can get help with gcloud metastore tools, resources, and commands by using the \u003ccode\u003e--help\u003c/code\u003e flag, or by referring to the Google Cloud CLI reference documentation.\u003c/p\u003e\n"],["\u003cp\u003eDefault configuration properties such as project, location, and tier for your Dataproc Metastore services can be set in your local client.\u003c/p\u003e\n"],["\u003cp\u003eThe default project ID, Dataproc Metastore location, and tier can be set using \u003ccode\u003egcloud config set\u003c/code\u003e commands with the appropriate flags and values.\u003c/p\u003e\n"]]],[],null,["# Use the Google Cloud CLI\n\nAs an alternative to using the [Dataproc Metastore APIs](/dataproc-metastore/docs/reference/rest),\nyou can manage and access Dataproc Metastore services\nusing [Google Cloud CLI](/sdk) `gcloud metastore` commands.\n\nThis page explains how to get started using the Google Cloud CLI, so you can use it\nto interact with Dataproc Metastore.\n\nBefore you begin\n----------------\n\n- Sign in to your Google Cloud account. If you're new to Google Cloud, [create an account](https://console.cloud.google.com/freetrial) to evaluate how our products perform in real-world scenarios. New customers also get $300 in free credits to run, test, and deploy workloads.\n- In the Google Cloud console, on the project selector page,\n select or create a Google Cloud project.\n\n | **Note**: If you don't plan to keep the resources that you create in this procedure, create a project instead of selecting an existing project. After you finish these steps, you can delete the project, removing all resources associated with the project.\n\n [Go to project selector](https://console.cloud.google.com/projectselector2/home/dashboard)\n-\n\n\n Enable the Dataproc Metastore API.\n\n\n [Enable the API](https://console.cloud.google.com/flows/enableapi?apiid=metastore.googleapis.com)\n-\n [Install](/sdk/docs/install) the Google Cloud CLI.\n\n | **Note:** If you installed the gcloud CLI previously, make sure you have the latest version by running `gcloud components update`.\n- If you're using an external identity provider (IdP), you must first\n [sign in to the gcloud CLI with your federated identity](/iam/docs/workforce-log-in-gcloud).\n\n-\n To [initialize](/sdk/docs/initializing) the gcloud CLI, run the following command:\n\n ```bash\n gcloud init\n ```\n\n- In the Google Cloud console, on the project selector page,\n select or create a Google Cloud project.\n\n | **Note**: If you don't plan to keep the resources that you create in this procedure, create a project instead of selecting an existing project. After you finish these steps, you can delete the project, removing all resources associated with the project.\n\n [Go to project selector](https://console.cloud.google.com/projectselector2/home/dashboard)\n-\n\n\n Enable the Dataproc Metastore API.\n\n\n [Enable the API](https://console.cloud.google.com/flows/enableapi?apiid=metastore.googleapis.com)\n-\n [Install](/sdk/docs/install) the Google Cloud CLI.\n\n | **Note:** If you installed the gcloud CLI previously, make sure you have the latest version by running `gcloud components update`.\n- If you're using an external identity provider (IdP), you must first\n [sign in to the gcloud CLI with your federated identity](/iam/docs/workforce-log-in-gcloud).\n\n-\n To [initialize](/sdk/docs/initializing) the gcloud CLI, run the following command:\n\n ```bash\n gcloud init\n ```\n\n\u003cbr /\u003e\n\nGet started with the Google Cloud CLI\n-------------------------------------\n\nTo start with the gcloud CLI, review the\n[Google Cloud CLI Documentation](/sdk/docs).\nYou can get help for the tool, resources, and commands by using the `--help`\nflag: \n\n gcloud metastore --help\n\nThe [Google Cloud CLI reference](/sdk/gcloud/reference) also provides the information\nshown by the `--help` flag.\n\nSet default configuration properties in your local client\n---------------------------------------------------------\n\nMost `gcloud metastore` commands require a location, which you specify using\nthe `--location` flag or by setting the default location. You can also set the\ndefault project and tier for your Dataproc Metastore services.\n\n1. To set the default project, run the following command: \n\n ```\n gcloud config set project PROJECT_ID\n ```\n\n where \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e is the ID of the Google Cloud project that the\n Dataproc Metastore service belongs to.\n2. To configure the Dataproc Metastore location, run the following command: \n\n ```\n gcloud config set metastore/location LOCATION\n ```\n\n where \u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e is a supported region such as `us-central1`.\n3. To configure the Dataproc Metastore tier, run the following command: \n\n ```\n gcloud config set metastore/tier TIER\n ```\n\n where \u003cvar translate=\"no\"\u003eTIER\u003c/var\u003e sets the capacity of the new service.\n4. Optional: To list the configuration for the gcloud CLI, run the following command: \n\n ```\n gcloud config list\n ```\n\nWhat's next\n-----------\n\n- [Dataproc Metastore gcloud commands](/sdk/gcloud/reference/metastore)\n- [Enabling the API](/dataproc-metastore/docs/enable-service)\n- [Quickstart for deploying Dataproc Metastore](/dataproc-metastore/docs/create-service-cluster)"]]