Memorystore for Valkey תומך בקבוצת משנה של פרמטרים להגדרת OSS Valkey שאפשר לשנות כדי להתאים אישית את ההתנהגות של המופע.
שינויים בהגדרות לא מחייבים הפעלה מחדש של הצמתים, והם נשמרים אם צומת מופעל מחדש. אחרי שיוצרים מופע, אפשר לעדכן את פרמטרי ההגדרות שניתנים לשינוי.
מידע נוסף על פרמטרים של הגדרות שאפשר לשנות זמין במאמר הגדרות נתמכות של מופעים.
לפני שמתחילים
כדי לוודא שהתקנתם את הגרסה העדכנית של Google Cloud CLI, מריצים את הפקודה gcloud components update.
הצגת פרמטרים של הגדרות
כדי להציג את פרמטרי ההגדרה באמצעות Google Cloud CLI, מריצים את הפקודה gcloud memorystore instances describe ומחליפים את variables בערכים המתאימים.
אי אפשר לראות את פרמטרי ההגדרה כשמריצים את הפקודה gcloud memorystore instances describe, אלא אם משנים פרמטר הגדרה מערך ברירת המחדל שלו.
gcloud memorystore instances describe instance-id --location=region-id
דוגמה:
gcloud memorystore instances describe my-instance --location=us-central1
הגדרת פרמטר קונפיגורציה במהלך יצירת מכונה
כדי להגדיר פרמטר הגדרה בזמן יצירת מכונה, מריצים את הפקודה gcloud memorystore instances create עם הדגל --engine-configs, ומחליפים את variables בערכים המתאימים.
gcloud memorystore instances create instance-id \ --location=region-id \ --project=project-id \ --node-type=node-type \ --shard-count=shard-count \ --mode=MODE --engine-configs=config-name=config-value \
מחליפים את מה שכתוב בשדות הבאים:
- instance-id הוא המזהה של מופע Memorystore for Valkey שאתם יוצרים.
- region-id הוא האזור שבו רוצים למקם את המכונה.
- project-id הוא מזהה הפרויקט.
node-type הוא סוג הצומת של המופע.
shard-count קובע את מספר הרסיסים במופע. מספר הרסיסים קובע את קיבולת הזיכרון הכוללת לאחסון נתוני המופע. אם המצב שבוחרים הוא Cluster Mode Disabled (מצב אשכול מושבת), אפשר לציין רק רסיס אחד למופע. מידע נוסף זמין במאמר Instance and node specification.
mode קובע אם המופע הוא Cluster Mode Enabled (הפעלה של מצב אשכול) או Cluster Mode Disabled (השבתה של מצב אשכול). אם השדה הזה מושמט, המופע מוגדר כברירת מחדל כ-Cluster Mode Enabled. מידע נוסף זמין במאמר הפעלה והשבתה של מצב אשכול.
config-name הוא פרמטר ההגדרה שרוצים לשנות.
config-value היא ההגדרה שבחרתם שמתאימה לפרמטר שאתם מגדירים.
לדוגמה:
דוגמה להפעלת מצב אשכול
gcloud memorystore instances create foo --location=us-east1 --project=test-proj --node-type=highmem-medium --shard-count=3 --engine-configs=maxmemory-policy=allkeys-lru
דוגמה להשבתה של מצב אשכול
gcloud memorystore instances create foo --location=us-east1 --project=test-proj --node-type=highmem-medium --shard-count=1 --mode=cluster-disabled --engine-configs=maxmemory-policy=allkeys-lru
עדכון פרמטר הגדרה
כדי לעדכן פרמטר הגדרה עבור מופע קיים, מריצים את הפקודה gcloud memorystore instances update עם הדגל --update-engine-configs, ומחליפים את variables בערכים המתאימים.
gcloud memorystore instances update instance-id \ --location=region-id \ --project=project-id \ --update-engine-configs=config-name=config-value
דוגמה:
gcloud memorystore instances update foo --location=us-east1 --project=test-proj --update-engine-configs=maxmemory-policy=allkeys-lru
איפוס פרמטר הגדרה
כדי לאפס פרמטר הגדרה לערך ברירת המחדל שלו, מריצים את הפקודה gcloud memorystore instances update עם הדגל --remove-engine-configs, ומחליפים את variables בערכים המתאימים.
gcloud memorystore instances update instance-id \ --location=region-id \ --project=project-id \ --remove-engine-configs=config-name
דוגמה:
gcloud memorystore instances update foo --location=us-east1 --project=test-proj --remove-engine-configs=maxmemory-policy
ניקוי פרמטרים של הגדרות
כדי לנקות את כל פרמטרי ההגדרה ולהחזיר אותם לערכי ברירת המחדל, מריצים את הפקודה gcloud memorystore instances update עם הדגל --clear-engine-configs, ומחליפים את variables בערכים המתאימים.
gcloud memorystore instances update instance-id \ --location=region-id \ --project=project-id \ --clear-engine-configs
דוגמה:
gcloud memorystore instances update foo --location=us-east1 --project=test-proj --clear-engine-configs