In alternativa all'utilizzo delle API Dataproc Metastore, puoi gestire e accedere ai servizi Dataproc Metastore utilizzando i comandi gcloud metastore
di Google Cloud CLI.
Questa pagina spiega come iniziare a utilizzare Google Cloud CLI, in modo da poterla utilizzare per interagire con Dataproc Metastore.
Prima di iniziare
- 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.
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
(
roles/resourcemanager.projectCreator
), which contains theresourcemanager.projects.create
permission. 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.enable
permission. Learn how to grant roles. -
Install the Google Cloud CLI.
-
Se utilizzi un provider di identità (IdP) esterno, devi prima accedere a gcloud CLI con la tua identità federata.
-
Per inizializzare gcloud CLI, esegui questo comando:
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
(
roles/resourcemanager.projectCreator
), which contains theresourcemanager.projects.create
permission. 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.enable
permission. Learn how to grant roles. -
Install the Google Cloud CLI.
-
Se utilizzi un provider di identità (IdP) esterno, devi prima accedere a gcloud CLI con la tua identità federata.
-
Per inizializzare gcloud CLI, esegui questo comando:
gcloud init
- Per impostare il progetto predefinito, esegui questo comando:
gcloud config set project PROJECT_ID
dove PROJECT_ID è l'ID del progetto Google Cloud a cui appartiene il servizio Dataproc Metastore.
- Per configurare la posizione di Dataproc Metastore, esegui il seguente comando:
gcloud config set metastore/location LOCATION
dove LOCATION è una regione supportata, ad esempio
us-central1
. - Per configurare il livello Dataproc Metastore, esegui il comando seguente:
gcloud config set metastore/tier TIER
dove TIER imposta la capacità del nuovo servizio.
- (Facoltativo) Per elencare la configurazione di gcloud CLI, esegui questo comando:
gcloud config list
- Comandi gcloud di Dataproc Metastore
- Attivazione dell'API
- Guida rapida per il deployment di Dataproc Metastore
Inizia a utilizzare Google Cloud CLI
Per iniziare a utilizzare gcloud CLI, consulta la
documentazione di Google Cloud CLI.
Puoi ricevere assistenza per lo strumento, le risorse e i comandi utilizzando il flag --help
:
gcloud metastore --help
Il riferimento di Google Cloud CLI fornisce anche le informazioni
mostrate dal flag --help
.
Impostare le proprietà di configurazione predefinite nel client locale
La maggior parte dei comandi gcloud metastore
richiede una località, che puoi specificare utilizzando il flag --location
o impostando la località predefinita. Puoi anche impostare il progetto e il livello predefiniti per i tuoi servizi Dataproc Metastore.