En este documento, se describe cómo configurar un Google Cloud proyecto y una máquina virtual (VM) de Compute Engine.
Configura un Google Cloud proyecto
- 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.
-
Make sure that billing is enabled for your Google Cloud project.
-
Enable the Google Cloud Dataproc API.
-
Install the Google Cloud CLI.
-
If you're using an external identity provider (IdP), you must first sign in to the gcloud CLI with your federated identity.
-
To initialize the gcloud CLI, run the following command:
gcloud init
-
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
-
Make sure that billing is enabled for your Google Cloud project.
-
Enable the Google Cloud Dataproc API.
-
Install the Google Cloud CLI.
-
If you're using an external identity provider (IdP), you must first sign in to the gcloud CLI with your federated identity.
-
To initialize the gcloud CLI, run the following command:
gcloud init
¿Necesitas credenciales? Solo necesitas credenciales si planeas llamar directamente a las APIs de Dataproc desde tu aplicación o desde un navegador. Si planeas usar la Google Cloud consola o laCLI de Google Cloud para crear y administrar clústeres, y enviar trabajos, solo necesitas acceder al SDK con el comando gcloud init
.
Opcional: Configura una VM
Si planeas ejecutar la CLI de gcloud desde una instancia de máquina virtual (VM) de Compute Engine, la VM debe estar configurada para acceder a los servicios de Google Cloud .
Para probar si tu VM está configurada de forma correcta, ejecuta gcloud compute instances describe YOUR_VM_INSTANCE_NAME
desde la línea de comandos. Se debe incluir una cuenta de servicio que incluya el alcance https://www.googleapis.com/auth/cloud-platform
. Para obtener más información sobre cómo configurar una VM, consulta Crea una VM que use una cuenta de servicio administrada por el usuario.