במאמר הזה מוסבר איך להתקין את כלי ההעברה של Spanner (SMT) ולהפעיל אותו ב-Cloud Shell. מידע נוסף על SMT זמין במאמר כלי ההעברה של Spanner.
לפני שמתחילים
- נכנסים לחשבון 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.
-
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.
- התקינו את ה-CLI של Google Cloud.
-
כדי לאתחל את Google Cloud CLI, מריצים את הפקודה
gcloud init.
התקנת כלי ההעברה של Spanner
אפשר להתקין את SMT באמצעות פקודת Linux Shell או Google Cloud CLI:
מעטפת Linux
כדי להתקין את SMT, מריצים את הפקודה הבאה:
sudo apt-get install google-cloud-sdk-spanner-migration-tool
gcloud
אפשר להתקין את SMT באמצעות הפקודה gcloud components install:
gcloud components install spanner-migration-tool
מידע נוסף על התקנת SMT זמין במאמר בנושא התקנת כלי ההעברה של Spanner.
גישה לכלי ההעברה של Spanner
אפשר להשתמש בפקודה gcloud alpha spanner migrate כדי לגשת ל-SMT ולהשתמש בו.
כדי להפעיל את ממשק האינטרנט של SMT, מריצים את הפקודה הבאה:
gcloud alpha spanner migrate web
כדי לאפשר ל-SMT לגשת למשאבים, צריך לספק את פרטי הכניסה שלכם ב- Google Cloud . לוחצים על http://localhost:8080 בתגובה לפקודה הקודמת כדי לפתוח את ממשק המשתמש האינטרנטי.
חיבור ל-Spanner
כדי להתחבר ל-Spanner באמצעות ממשק המשתמש האינטרנטי של SMT:
לוחצים על לחצן העריכה כדי להגדיר את החיבור ל-Spanner.
כדי להתחבר ל-Spanner, צריך לציין את הפרטים הבאים:
- מזהה הפרויקט: מזהה הפרויקט שבו נמצא מופע Spanner.
- Instance ID (מזהה מכונה): מזהה מכונת Spanner.
לוחצים על Save.
התחברות למסד הנתונים של המקור
כדי להתחבר למסד הנתונים של המקור באמצעות ממשק המשתמש האינטרנטי של SMT, צריך לספק את הפרטים הבאים:
- Database Engine (מנוע מסד הנתונים): מציינים אם מסד הנתונים של המקור הוא MySQL, SQL Server, Oracle או PostgreSQL.
- שם המארח: כתובת ה-IP של מסד הנתונים של המקור.
- יציאה: היציאה שדרכה אפשר לגשת למסד הנתונים של המקור.
- שם משתמש: שם המשתמש של מסד הנתונים של המקור.
- סיסמה: הסיסמה של מסד הנתונים של המקור.
- ניב Spanner: מציינים אם רוצים להשתמש ב-GoogleSQL או ב-PostgreSQL.
אחרי שמזינים את הפרטים, אפשר להתחבר למסד הנתונים של המקור על ידי לחיצה על בדיקת החיבור ואז על חיבור.