كيفية إنشاء Azure Cache for Redis وإدارتها باستخدام Azure classic CLI
يُعد Azure classic CLI طريقة رائعة لإدارة البنية الأساسية لـ Azure من أي نظام أساسي. توضح هذه المقالة كيفية إنشاء مثيلات Azure Cache for Redis وإدارتها باستخدام Azure classic CLI.
هام
تحتوي هذه المقالة على محتوى يتطلب Azure classic CLI. هذا إصدار أقدم من Azure CLI يجب استخدامه فقط مع نموذج التوزيع الكلاسيكي Azure.
لتثبيت classic CLI، راجع تثبيت Azure classic CLI وتثبيت Azure CLI الحالي لتوزيعات Azure Resource Manager، راجع تثبيت Azure CLI.
إشعار
للحصول على أحدث نماذج البرامج النصية لـ Azure CLI، راجع نماذج Azure CLI Azure Cache for Redis.
المتطلبات الأساسية
لإنشاء مثيلات Azure Cache for Redis وإدارتها باستخدام Azure classic CLI، يجب إكمال الخطوات التالية.
- يجب أن يكون لديك حساب Azure. إذا لم يكن لديك حساب، يمكنك إنشاء حساب مجاني في بضع دقائق فقط.
- تثبيت Azure classic CLI.
- قم بتوصيل تثبيت Azure CLI بحساب Azure شخصي، أو بحساب Azure للعمل أو المدرسة، وسجل الدخول من classic CLI باستخدام الأمر
azure login
. - قبل تشغيل أي من الأوامر التالية، قم بتبديل classic CLI إلى وضع Resource Manager عن طريق تشغيل الأمر
azure config mode arm
. لمزيدٍ من المعلومات، راجع استخدام Azure classic CLI لإدارة موارد Azure ومجموعات الموارد.
خصائص Azure Cache for Redis
يتم استخدام الخصائص التالية عند إنشاء مثيلات Azure Cache for Redis وتحديثها.
الخاصية | Switch | الوصف |
---|---|---|
الاسم | -n, --name | اسم Azure Cache for Redis. |
مجموعة الموارد | -g, --resource-group | اسم مجموعة الموارد. |
موقع | -l، --الموقع | موقع لإنشاء ذاكرة التخزين المؤقت. |
size | -z, --size | حجم Azure Cache لـ Redis. القيم الصالحة: [C0، C1، C2، C3، C4، C5، C6، P1، P2، P3، P4] |
sku | -x, --sku | Redis SKU. يجب أن يكون واحداً من: [أساسي، قياسي، متميز] |
EnableNonSslPort | -e, --enable-non-ssl-port | خاصية EnableNonSslPort لـ Azure Cache for Redis. أضف هذه العلامة إذا كنت تريد تمكين المنفذ غير TLS/SSL لذاكرة التخزين المؤقت الخاصة بك |
تكوين Redis | -c, --redis-configuration | تكوين Redis. أدخل سلسلة بتنسيق JSON من مفاتيح التكوين والقيم هنا. التنسيق:"{"":"","":""}" |
تكوين Redis | -f, --redis-configuration-file | تكوين Redis. أدخل مسار ملف يحتوي على مفاتيح التكوين والقيم هنا. تنسيق إدخال الملف: {"":"","":""} |
عدد علب البريد المقطعية | -r, --shard-count | عدد الأجزاء المراد إنشاؤها على ذاكرة التخزين المؤقت لنظام المجموعة المتميزة مع التجميع. |
شبكة ظاهرية | -v, --virtual-network | عند استضافة ذاكرة التخزين المؤقت في VNET، يحدد معرف مورد Resource Manager الدقيق للشبكة الظاهرية لنشر Azure Cache for Redis في. مثال على التنسيق: /subscriptions/{subid}/resourceGroups/{resourceGroupName}/Microsoft.ClassicNetwork/VirtualNetworks/vnet1 |
نَوع المفتاح | -t, --key-type | نوع المفتاح للتجديد. القيم الصالحة: [أساسي، ثانوي] |
StaticIP | -p, --static-ip <static-ip> | عند استضافة ذاكرة التخزين المؤقت في VNET، يحدد عنوان IP فريدًا في الشبكة الفرعية لذاكرة التخزين المؤقت. إذا لم يتم توفيرها، يتم اختيار واحدًا لك من الشبكة الفرعية. |
الشبكة الفرعية | t, --subnet <الشبكة الفرعية> | عند استضافة ذاكرة التخزين المؤقت في VNET، يحدد اسم الشبكة الفرعية التي سيتم فيها توزيع ذاكرة التخزين المؤقت. |
VirtualNetwork | -v, --virtual-network <virtual-network> | عند استضافة ذاكرة التخزين المؤقت في VNET، يحدد معرف مورد Resource Manager الدقيق للشبكة الظاهرية لنشر Azure Cache for Redis في. مثال على التنسيق: /subscriptions/{subid}/resourceGroups/{resourceGroupName}/Microsoft.ClassicNetwork/VirtualNetworks/vnet1 |
الوصف | -s, --الاشتراك | معرف الاشتراك. |
راجع جميع أوامر Azure Cache for Redis
لمشاهدة جميع أوامر Azure Cache for Redis ومعلماتها، استخدم الأمر azure rediscache -h
.
C:\>azure rediscache -h
help: Commands to manage your Azure Cache for Redis(s)
help:
help: Create an Azure Cache for Redis
help: rediscache create [--name <name> --resource-group <resource-group> --location <location> [options]]
help:
help: Delete an existing Azure Cache for Redis
help: rediscache delete [--name <name> --resource-group <resource-group> ]
help:
help: List all Azure Cache for Redis within your Subscription or Resource Group
help: rediscache list [options]
help:
help: Show properties of an existing Azure Cache for Redis
help: rediscache show [--name <name> --resource-group <resource-group>]
help:
help: Change settings of an existing Azure Cache for Redis
help: rediscache set [--name <name> --resource-group <resource-group> --redis-configuration <redis-configuration>/--redis-configuration-file <redisConfigurationFile>]
help:
help: Renew the authentication key for an existing Azure Cache for Redis
help: rediscache renew-key [--name <name> --resource-group <resource-group> ]
help:
help: Lists Primary and Secondary key of an existing Azure Cache for Redis
help: rediscache list-keys [--name <name> --resource-group <resource-group>]
help:
help: Options:
help: -h, --help output usage information
help:
help: Current Mode: arm (Azure Resource Management)
إنشاء Azure Cache for Redis
لإنشاء Azure Cache for Redis، استخدم الأمر التالي:
azure rediscache create [--name <name> --resource-group <resource-group> --location <location> [options]]
لمزيدٍ من المعلومات حول هذا الأمر، قم بتشغيل الأمر azure rediscache create -h
.
C:\>azure rediscache create -h
help: Create an Azure Cache for Redis
help:
help: Usage: rediscache create [--name <name> --resource-group <resource-group> --location <location> [options]]
help:
help: Options:
help: -h, --help output usage information
help: -v, --verbose use verbose output
help: -vv more verbose with debug output
help: --json use json output
help: -n, --name <name> Name of the Azure Cache for Redis.
help: -g, --resource-group <resource-group> Name of the Resource Group
help: -l, --location <location> Location to create cache.
help: -z, --size <size> Size of the Azure Cache for Redis. Valid values: [C0, C1, C2, C3, C4, C5, C6, P1, P2, P3, P4]
help: -x, --sku <sku> Redis SKU. Should be one of : [Basic, Standard, Premium]
help: -e, --enable-non-ssl-port EnableNonSslPort property of the Azure Cache for Redis. Add this flag if you want to enable the non-TLS/SSL Port for your cache
help: -c, --redis-configuration <redis-configuration> Redis Configuration. Enter a JSON formatted string of configuration keys and values here. Format:"{"<key1>":"<value1>","<key2>":"<value2>"}"
help: -f, --redis-configuration-file <redisConfigurationFile> Redis Configuration. Enter the path of a file containing configuration keys and values here. Format for the file entry: {"<key1>":"<value1>","<key2>":"<value2>"}
help: -r, --shard-count <shard-count> Number of Shards to create on a Premium Cluster Cache
help: -v, --virtual-network <virtual-network> The exact ARM resource ID of the virtual network to deploy the Azure Cache for Redis in. Example format: /subscriptions/{subid}/resourceGroups/{resourceGroupName}/Microsoft.ClassicNetwork/VirtualNetworks/vnet1
help: -t, --subnet <subnet> Required when deploying an Azure Cache for Redis inside an existing Azure Virtual Network
help: -p, --static-ip <static-ip> Required when deploying an Azure Cache for Redis inside an existing Azure Virtual Network
help: -s, --subscription <id> the subscription identifier
help:
help: Current Mode: arm (Azure Resource Management)
حذف Azure Cache for Redis موجود
لحذف Azure Cache for Redis، استخدم الأمر التالي:
azure rediscache delete [--name <name> --resource-group <resource-group> ]
لمزيدٍ من المعلومات حول هذا الأمر، قم بتشغيل الأمر azure rediscache delete -h
.
C:\>azure rediscache delete -h
help: Delete an existing Azure Cache for Redis
help:
help: Usage: rediscache delete [--name <name> --resource-group <resource-group> ]
help:
help: Options:
help: -h, --help output usage information
help: -v, --verbose use verbose output
help: -vv more verbose with debug output
help: --json use json output
help: -n, --name <name> Name of the Azure Cache for Redis.
help: -g, --resource-group <resource-group> Name of the Resource Group under which the cache exists
help: -s, --subscription <subscription> the subscription identifier
help:
help: Current Mode: arm (Azure Resource Management)
سرد جميع Azure Cache for Redis ضمن الاشتراك أو مجموعة الموارد
لسرد جميع Azure Cache for Redis ضمن الاشتراك أو مجموعة الموارد، استخدم الأمر التالي:
azure rediscache list [options]
لمزيدٍ من المعلومات حول هذا الأمر، قم بتشغيل الأمر azure rediscache list -h
.
C:\>azure rediscache list -h
help: List all Azure Cache for Redis within your Subscription or Resource Group
help:
help: Usage: rediscache list [options]
help:
help: Options:
help: -h, --help output usage information
help: -v, --verbose use verbose output
help: -vv more verbose with debug output
help: --json use json output
help: -g, --resource-group <resource-group> Name of the Resource Group
help: -s, --subscription <subscription> the subscription identifier
help:
help: Current Mode: arm (Azure Resource Management)
إظهار خصائص Azure Cache for Redis موجود
لإظهار Azure Cache for Redis موجود، استخدم الأمر التالي:
azure rediscache show [--name <name> --resource-group <resource-group>]
لمزيدٍ من المعلومات حول هذا الأمر، قم بتشغيل الأمر azure rediscache show -h
.
C:\>azure rediscache show -h
help: Show properties of an existing Azure Cache for Redis
help:
help: Usage: rediscache show [--name <name> --resource-group <resource-group>]
help:
help: Options:
help: -h, --help output usage information
help: -v, --verbose use verbose output
help: -vv more verbose with debug output
help: --json use json output
help: -n, --name <name> Name of the Azure Cache for Redis.
help: -g, --resource-group <resource-group> Name of the Resource Group
help: -s, --subscription <subscription> the subscription identifier
help:
help: Current Mode: arm (Azure Resource Management)
تغيير إعدادات Azure Cache for Redis موجود
لتغيير إعدادات Azure Cache for Redis موجود، استخدم الأمر التالي:
azure rediscache set [--name <name> --resource-group <resource-group> --redis-configuration <redis-configuration>/--redis-configuration-file <redisConfigurationFile>]
لمزيدٍ من المعلومات حول هذا الأمر، قم بتشغيل الأمر azure rediscache set -h
.
C:\>azure rediscache set -h
help: Change settings of an existing Azure Cache for Redis
help:
help: Usage: rediscache set [--name <name> --resource-group <resource-group> --redis-configuration <redis-configuration>/--redis-configuration-file <redisConfigurationFile>]
help:
help: Options:
help: -h, --help output usage information
help: -v, --verbose use verbose output
help: -vv more verbose with debug output
help: --json use json output
help: -n, --name <name> Name of the Azure Cache for Redis.
help: -g, --resource-group <resource-group> Name of the Resource Group
help: -c, --redis-configuration <redis-configuration> Redis Configuration. Enter a JSON formatted string of configuration keys and values here.
help: -f, --redis-configuration-file <redisConfigurationFile> Redis Configuration. Enter the path of a file containing configuration keys and values here.
help: -s, --subscription <subscription> the subscription identifier
help:
help: Current Mode: arm (Azure Resource Management)
تجديد مفتاح المصادقة لـ Azure Cache for Redis موجود
لتجديد مفتاح المصادقة لـ Azure Cache for Redis موجود، استخدم الأمر التالي:
azure rediscache renew-key [--name <name> --resource-group <resource-group> --key-type <key-type>]
حدد Primary
أو Secondary
لـ key-type
.
لمزيدٍ من المعلومات حول هذا الأمر، قم بتشغيل الأمر azure rediscache renew-key -h
.
C:\>azure rediscache renew-key -h
help: Renew the authentication key for an existing Azure Cache for Redis
help:
help: Usage: rediscache renew-key [--name <name> --resource-group <resource-group> ]
help:
help: Options:
help: -h, --help output usage information
help: -v, --verbose use verbose output
help: -vv more verbose with debug output
help: --json use json output
help: -n, --name <name> Name of the Azure Cache for Redis.
help: -g, --resource-group <resource-group> Name of the Resource Group under which cache exists
help: -t, --key-type <key-type> type of key to renew. Valid values are: 'Primary', 'Secondary'.
help: -s, --subscription <subscription> the subscription identifier
help:
help: Current Mode: arm (Azure Resource Management)
سرد المفاتيح الأساسية والثانوية لـ Azure Cache for Redis موجود
لسرد المفاتيح الأساسية والثانوية لـ Azure Cache for Redis موجود، استخدم الأمر التالي:
azure rediscache list-keys [--name <name> --resource-group <resource-group>]
لمزيدٍ من المعلومات حول هذا الأمر، قم بتشغيل الأمر azure rediscache list-keys -h
.
C:\>azure rediscache list-keys -h
help: Lists Primary and Secondary key of an existing Azure Cache for Redis
help:
help: Usage: rediscache list-keys [--name <name> --resource-group <resource-group>]
help:
help: Options:
help: -h, --help output usage information
help: -v, --verbose use verbose output
help: -vv more verbose with debug output
help: --json use json output
help: -n, --name <name> Name of the Azure Cache for Redis.
help: -g, --resource-group <resource-group> Name of the Resource Group under which Cache exists
help: -s, --subscription <subscription> the subscription identifier
help:
help: Current Mode: arm (Azure Resource Management)