Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Sebagai alternatif untuk menggunakan Dataproc Metastore API, Anda dapat mengelola dan mengakses layanan Dataproc Metastore menggunakan perintah gcloud metastoreGoogle Cloud CLI.
Halaman ini menjelaskan cara mulai menggunakan Google Cloud CLI, sehingga Anda dapat menggunakannya
untuk berinteraksi dengan Dataproc Metastore.
Sebelum memulai
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.
Menetapkan properti konfigurasi default di klien lokal Anda
Sebagian besar perintah gcloud metastore memerlukan lokasi, yang Anda tentukan menggunakan
flag --location atau dengan menyetel lokasi default. Anda juga dapat menetapkan project dan paket default untuk layanan Dataproc Metastore Anda.
Untuk menetapkan project default, jalankan perintah berikut:
gcloud config set project PROJECT_ID
dengan PROJECT_ID adalah ID project Google Cloud tempat layanan
Dataproc Metastore berada.
Untuk mengonfigurasi lokasi Dataproc Metastore, jalankan perintah berikut:
gcloud config set metastore/location LOCATION
dengan LOCATION adalah region yang didukung seperti us-central1.
Untuk mengonfigurasi tingkat Dataproc Metastore, jalankan perintah berikut:
gcloud config set metastore/tier TIER
dengan TIER menetapkan kapasitas layanan baru.
Opsional: Untuk mencantumkan konfigurasi gcloud CLI, jalankan perintah berikut:
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Sulit dipahami","hardToUnderstand","thumb-down"],["Informasi atau kode contoh salah","incorrectInformationOrSampleCode","thumb-down"],["Informasi/contoh yang saya butuhkan tidak ada","missingTheInformationSamplesINeed","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 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)"]]