במאמר הזה מוסבר איך להגדיר Google Cloud פרויקט ומכונה וירטואלית (VM) של Compute Engine.
הגדרת Google Cloud פרויקט
- נכנסים לחשבון Google Cloud . אם אתם משתמשים חדשים ב- Google Cloud, צרו חשבון כדי שתוכלו להעריך את הביצועים של המוצרים שלנו בתרחישים מהעולם האמיתי. לקוחות חדשים מקבלים בחינם גם קרדיט בשווי 300$ להרצה, לבדיקה ולפריסה של עומסי העבודה.
-
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 role
(
roles/resourcemanager.projectCreator), which contains theresourcemanager.projects.createpermission. Learn how to grant roles.
-
Verify that billing is enabled for your Google Cloud project.
Enable the Google Cloud Dataproc API.
Roles required to enable APIs
To enable APIs, you need the Service Usage Admin IAM role (
roles/serviceusage.serviceUsageAdmin), which contains theserviceusage.services.enablepermission. Learn how to grant roles.-
התקינו את ה-CLI של Google Cloud.
-
אם אתם משתמשים בספק זהויות חיצוני (IdP), קודם אתם צריכים להיכנס ל-CLI של gcloud באמצעות המאגר המאוחד לניהול זהויות.
-
כדי לאתחל את ה-CLI של gcloud, הריצו את הפקודה הבאה:
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 role
(
roles/resourcemanager.projectCreator), which contains theresourcemanager.projects.createpermission. Learn how to grant roles.
-
Verify that billing is enabled for your Google Cloud project.
Enable the Google Cloud Dataproc API.
Roles required to enable APIs
To enable APIs, you need the Service Usage Admin IAM role (
roles/serviceusage.serviceUsageAdmin), which contains theserviceusage.services.enablepermission. Learn how to grant roles.-
התקינו את ה-CLI של Google Cloud.
-
אם אתם משתמשים בספק זהויות חיצוני (IdP), קודם אתם צריכים להיכנס ל-CLI של gcloud באמצעות המאגר המאוחד לניהול זהויות.
-
כדי לאתחל את ה-CLI של gcloud, הריצו את הפקודה הבאה:
gcloud init
האם נדרשים פרטי כניסה? אתם צריכים פרטי כניסה רק אם אתם מתכננים לקרוא ישירות לממשקי Managed Service for Apache Spark API מהאפליקציה שלכם או מדפדפן. אם אתם מתכננים להשתמש במסוף Google Cloud או ב-Google Cloud CLI כדי ליצור ולנהל אשכולות ולשלוח משימות, אתם צריכים רק להיכנס ל-SDK באמצעות הפקודה gcloud init.
אופציונלי: הגדרת מכונה וירטואלית
אם אתם מתכננים להריץ את ה-CLI של gcloud ממכונה וירטואלית (VM) של Compute Engine, צריך להגדיר את המכונה הווירטואלית כך שתהיה לה גישה לשירותי Google Cloud .
כדי לבדוק אם המכונה הווירטואלית מוגדרת בצורה נכונה, מריצים את הפקודה
gcloud compute instances describe YOUR_VM_INSTANCE_NAME
משורת הפקודה. צריך לציין חשבון שירות שכולל את היקף ההרשאות https://www.googleapis.com/auth/cloud-platform. מידע נוסף על הגדרת מכונה וירטואלית זמין במאמר יצירת מכונה וירטואלית שמשתמשת בחשבון שירות שמנוהל על ידי משתמש.