יצירת אשכול באמצעות תבנית

בדף הזה מוסבר איך להשתמש בתבנית מוטמעת של Google APIs Explorer כדי ליצור אשכול של Managed Service for Apache Spark.

דרכים נוספות ליצירת אשכול:

לפני שמתחילים

  1. נכנסים לחשבון Google Cloud . אם אתם משתמשים חדשים ב- Google Cloud, צרו חשבון כדי שתוכלו להעריך את הביצועים של המוצרים שלנו בתרחישים מהעולם האמיתי. לקוחות חדשים מקבלים בחינם גם קרדיט בשווי 300$ להרצה, לבדיקה ולפריסה של עומסי העבודה.
  2. 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 the resourcemanager.projects.create permission. Learn how to grant roles.

    Go to project selector

  3. Verify that you have the permissions required to complete this guide.

  4. Verify that billing is enabled for your Google Cloud project.

  5. Enable the Dataproc API.

    Roles required to enable APIs

    To enable APIs, you need the Service Usage Admin IAM role (roles/serviceusage.serviceUsageAdmin), which contains the serviceusage.services.enable permission. Learn how to grant roles.

    Enable the API

  6. 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 the resourcemanager.projects.create permission. Learn how to grant roles.

    Go to project selector

  7. Verify that you have the permissions required to complete this guide.

  8. Verify that billing is enabled for your Google Cloud project.

  9. Enable the Dataproc API.

    Roles required to enable APIs

    To enable APIs, you need the Service Usage Admin IAM role (roles/serviceusage.serviceUsageAdmin), which contains the serviceusage.services.enable permission. Learn how to grant roles.

    Enable the API

התפקידים הנדרשים

כדי להריץ את הדוגמאות בדף הזה, צריך תפקידים מסוימים ב-IAM. יכול להיות שהתפקידים האלה כבר הוקצו, בהתאם למדיניות הארגון. כדי לבדוק את התפקידים שהוקצו, ראו האם צריך להקצות תפקידים?.

כדי לקרוא הסבר על מתן תפקידים, ראו איך מנהלים את הגישה ברמת הפרויקט, התיקייה והארגון.

תפקידי משתמשים

כדי לקבל את ההרשאות שדרושות ליצירת אשכול של Managed Service for Apache Spark, צריך לבקש מהאדמין להקצות לכם את תפקידי ה-IAM הבאים:

תפקיד בחשבון שירות

כדי לוודא שלחשבון השירות שמוגדר כברירת מחדל ב-Compute Engine יש את ההרשאות שנדרשות ליצירת אשכול של Managed Service for Apache Spark, צריך לבקש מהאדמין להקצות לחשבון השירות שמוגדר כברירת מחדל ב-Compute Engine את תפקיד ה-IAM Dataproc Worker (roles/dataproc.worker) בפרויקט.

יצירת אשכול

כדי להריץ משימות של Managed Service for Apache Spark, צריך ליצור אשכול של מכונות וירטואליות להרצת המשימות. כדי ליצור אשכול של Managed Service for Apache Spark בפרויקט שלכם, ממלאים את התבנית Try this Method של Google APIs Explorer בדף הזה ומריצים אותה (צריך לגלול או ללחוץ על Try it! כדי לעבור לתבנית).

  1. הפרמטרים של הבקשה:

    1. מזינים את projectId.
    2. מציינים את האזור שבו האשכול ימוקם (מאשרים את us-central1 או מחליפים אותו). מכיוון שלא מציינים תחום בתוך האזור בתחילת העבודה המהירה הזו, Managed Service for Apache Spark בחירת תחום אוטומטית (Auto Zone) יבחר תחום בתוך האזור שבו הוא ייצור את האשכול.
  2. גוף הבקשה:

    1. מציינים clusterName (מאשרים או מחליפים את example-cluster). תשתמשו בשם הזה כדי ליצור אינטראקציה עם האשכול, למשל כששולחים משימות או מעדכנים את האשכול.
  3. לוחצים על EXECUTE. בפעם הראשונה שמריצים את תבנית ה-API, יכול להיות שתתבקשו לבחור חשבון Google ולהיכנס אליו, ואז לאשר ל-Google APIs Explorer לגשת לחשבון שלכם. אם הבקשה מצליחה, תגובת ה-JSON תראה שיצירת האשכול נמצאת בהמתנה.

  4. כדי לאשר את יצירת האשכול, פותחים את הדף Managed Service for Apache Spark Clusters במסוף Google Cloud . אחרי שהקצאת האשכול תושלם, הסטטוס של האשכול יהיה 'פועל'.

הסרת המשאבים

כדי לא לצבור חיובים לחשבון Google Cloud על המשאבים שבהם השתמשתם בדף הזה, פועלים לפי השלבים הבאים:

  1. אם לא צריך את האשכול כדי לעיין במדריכים למתחילים אחרים או כדי להריץ משימות אחרות, אפשר להשתמש בAPIs Explorer, במסוףGoogle Cloud , בgcloud או בספריות הלקוח של Cloud כדי למחוק את האשכול.

המאמרים הבאים