Mantenha tudo organizado com as coleções
Salve e categorize o conteúdo com base nas suas preferências.
Como alternativa ao uso das APIs do metastore do Dataproc, é possível gerenciar e acessar os serviços do metastore do Dataproc usando os comandos gcloud metastore da Google Cloud CLI.
Nesta página, explicamos como usar a Google Cloud CLI para interagir com o metastore do Dataproc.
Antes de começar
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.
Para inicializar a gcloud CLI, execute o seguinte comando:
gcloudinit
Começar a usar a Google Cloud CLI
Para começar a usar a CLI gcloud, consulte a
documentação da CLI do Google Cloud.
Você pode receber ajuda com a ferramenta, ver os recursos e os comandos usando a sinalização --help:
Definir propriedades de configuração padrão no cliente local
A maioria dos comandos gcloud metastore requer um local, que você especifica usando a sinalização --location ou definindo o local padrão. Também é possível definir o projeto e o nível padrão para seus serviços do metastore do Dataproc.
Para definir o projeto padrão, execute o comando a seguir:
gcloud config set project PROJECT_ID
em que PROJECT_ID é o ID do projeto Google Cloud a que o serviço Metastore do Dataproc pertence.
Para configurar o local do metastore do Dataproc, execute o seguinte comando:
gcloud config set metastore/location LOCATION
em que LOCATION é uma região compatível como us-central1.
Para configurar o nível do metastore do Dataproc, execute o seguinte comando:
gcloud config set metastore/tier TIER
em que TIER define a capacidade do novo serviço.
Opcional: para listar a configuração da CLI gcloud, execute o seguinte comando:
[[["Fácil de entender","easyToUnderstand","thumb-up"],["Meu problema foi resolvido","solvedMyProblem","thumb-up"],["Outro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Informações incorretas ou exemplo de código","incorrectInformationOrSampleCode","thumb-down"],["Não contém as informações/amostras de que eu preciso","missingTheInformationSamplesINeed","thumb-down"],["Problema na tradução","translationIssue","thumb-down"],["Outro","otherDown","thumb-down"]],["Última atualização 2025-09-02 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)"]]