יצירת מכונת Memorystore for Memcached באמצעות מסוף Google Cloud
במדריך למתחילים הזה מוסבר איך ליצור מופע של Memorystore for Memcached, להתחבר למופע, להגדיר ערך, לאחזר ערך ולמחוק את המופע.
לפני שמתחילים
- נכנסים לחשבון 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.
-
מפעילים את Service Networking API בפרויקט.
הפעלת Service Networking API -
מפעילים בפרויקט את Memorystore for Memcached API.
הפעלת Memorystore for Memcached API
יצירת מופע Memcached
עוברים לדף Memorystore for Memcached במסוף Google Cloud .
Memorystore for Memcachedלוחצים על הלחצן יצירת מופע.
בדף Create a Memcached instance במסוף Google Cloud , בוחרים את ההגדרות למופע החדש:
- מזינים מזהה מופע שכולל רק אותיות קטנות, מספרים ומקפים.
להתחיל באות.
- לדוגמה,
my-memcached-instance-1.
- לדוגמה,
- בתפריט הנפתח אזור, בוחרים באפשרות
us-central1. - בוחרים באפשרות
Automatically distributeבתפריט הנפתח אזור. - מזינים
2בקטע Nodes כדי ליצור שני צמתים. - בוחרים באפשרות זיכרון לכל צומת בנפח 1GB.
- בוחרים באפשרות 1 בשדה Cores per node (ליבות לכל צומת).
בוחרים באפשרות
defaultבשדה רשת מורשית.
- מזינים מזהה מופע שכולל רק אותיות קטנות, מספרים ומקפים.
להתחיל באות.
לוחצים על יצירה.
אחרי שיוצרים את המופע, לוחצים על מזהה המופע כדי לראות את דף הפרטים של המופע.
רושמים את
IP addressשל אחד מהצמתים.
התחברות למופע ממכונה וירטואלית ב-Compute Engine
כדי לבדוק את החיבור:
מתחברים ל-VM של Linux. הוראות להתחברות ל-VM של Linux מפורטות במאמר מדריך למתחילים: שימוש ב-VM של Linux. אם השתמשתם באימג' שמבוסס על Debian כדי ליצור את המכונה הווירטואלית, כפי שמתואר במדריך לתחילת העבודה, אתם יכולים להתקין את
telnetבאמצעותapt-get:sudo apt-get install telnetמהטרמינל, מפעילים telnet לכתובת ה-IP של אחד מצמתי Memcached. מחליפים את node-ip-address בכתובת ה-IP של הצומת.
telnet node-ip-address 11211
הפלט אמור להיראות כך, כשבמקום
[bracketed-variables]מופיעים המשתנים של הפרויקט:Trying [node-ip-address]… Connected to [node-ip-address]
בסשן של telnet, מזינים כמה פקודות Memcached:
צריך להזין את הפרטים הבאים:
get greeting
תוצאה:
END
צריך להזין את הפרטים הבאים:
set greeting 1 0 11 hello world
תוצאה:
STORED
צריך להזין את הפרטים הבאים:
get greeting
תוצאה:
VALUE greeting 1 11 hello world END
Memorystore for Memcached תומך בספריות Memcached סטנדרטיות בקוד פתוח.
הסרת המשאבים
כדי לא לצבור חיובים לחשבון Google Cloud על המשאבים שבהם השתמשתם בדף הזה, פועלים לפי השלבים הבאים:
עוברים לדף Memorystore for Memcached במסוף Google Cloud .
Memorystore for Memcachedלוחצים על המזהה של המופע שרוצים למחוק.
לוחצים על הלחצן Delete.
בהנחיה שמופיעה, מזינים את מזהה המופע.
לוחצים על הלחצן Delete.