Azure Cache for Redis létrehozása és kezelése a klasszikus Azure CLI használatával

A klasszikus Azure CLI nagyszerű módja az Azure-infrastruktúra bármely platformról történő felügyeletének. Ez a cikk bemutatja, hogyan hozhat létre és kezelhet Azure Cache for Redis példányokat a klasszikus Azure cli használatával.

Fontos

Jelen cikk tartalmához az Azure klasszikus CLI szükséges. Ez az Azure CLI egy régebbi verziója, amely csak a klasszikus Azure üzemi modellel használható.

A klasszikus parancssori felület telepítéséhez lásd: A klasszikus Azure CLI telepítése és az azure Resource Manager-környezetekhez készült aktuális Azure CLI telepítése, lásd: Az Azure CLI telepítése.

Megjegyzés

A legújabb Azure CLI-mintaszkriptekért lásd: Azure CLI Azure Cache for Redis minták.

Előfeltételek

Ha Azure Cache for Redis példányokat szeretne létrehozni és kezelni a klasszikus Azure CLI használatával, hajtsa végre az alábbi lépéseket.

Azure Cache for Redis tulajdonságai

A Azure Cache for Redis példányok létrehozásakor és frissítésekor az alábbi tulajdonságokat használjuk.

Tulajdonság Kapcsoló (switch) Description
name -n, --name A Azure Cache for Redis neve.
erőforráscsoport -g, --resource-group Az erőforráscsoport neve.
location -l, --location A gyorsítótár létrehozásának helye.
size -z, --size A Azure Cache for Redis mérete. Érvényes értékek: [C0, C1, C2, C3, C4, C5, C6, P1, P2, P3, P4]
Sku -x, --sku Redis-termékváltozat. A következő egyiknek kell lennie: [Alapszintű, Standard, Prémium]
EnableNonSslPort -e, --enable-non-ssl-port A Azure Cache for Redis EnableNonSslPort tulajdonsága. Adja hozzá ezt a jelzőt, ha engedélyezni szeretné a nem TLS-/SSL-portot a gyorsítótárhoz
Redis-konfiguráció -c, --redis-configuration Redis-konfiguráció. Itt adhatja meg a konfigurációs kulcsok és értékek JSON formátumú sztringét. Formátum:"{"":"","":"}"
Redis-konfiguráció -f, --redis-configuration-file Redis-konfiguráció. Itt adhatja meg a konfigurációs kulcsokat és értékeket tartalmazó fájl elérési útját. A fájlbejegyzés formátuma: {"":"","}.
Szegmensek száma -r, --shard-count Fürtözéssel rendelkező prémium szintű fürtgyorsítótárban létrehozandó szegmensek száma.
Virtual Network -v, --virtual-network Ha a gyorsítótárat virtuális hálózaton üzemelteti, a virtuális hálózat pontos Resource Manager erőforrás-azonosítóját adja meg a Azure Cache for Redis üzembe helyezéséhez. Példaformátum: /subscriptions/{subid}/resourceGroups/{resourceGroupName}/Microsoft.ClassicNetwork/VirtualNetworks/vnet1
kulcs típusa -t, --key-type A megújítandó kulcs típusa. Érvényes értékek: [Elsődleges, Másodlagos]
StaticIP -p, --static-ip <static-ip> Ha virtuális hálózaton üzemelteti a gyorsítótárat, a gyorsítótár alhálózatában egy egyedi IP-címet ad meg. Ha nincs megadva, az alhálózatból választunk egyet.
Alhálózat t, --alhálózati <alhálózat> Ha virtuális hálózaton üzemelteti a gyorsítótárat, megadja annak az alhálózatnak a nevét, amelyben üzembe kívánja helyezni a gyorsítótárat.
VirtualNetwork -v, --virtual-network <virtual-network> Ha a gyorsítótárat virtuális hálózaton üzemelteti, a virtuális hálózat pontos Resource Manager erőforrás-azonosítóját adja meg a Azure Cache for Redis üzembe helyezéséhez. Példaformátum: /subscriptions/{subid}/resourceGroups/{resourceGroupName}/Microsoft.ClassicNetwork/VirtualNetworks/vnet1
Előfizetés -s, --subscription Az előfizetés azonosítója.

Az összes Azure Cache for Redis parancs megtekintése

Az összes Azure Cache for Redis parancs és paraméterük megtekintéséhez használja a azure rediscache -h parancsot.

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)

Az Azure Cache for Redis létrehozása

Azure Cache for Redis létrehozásához használja a következő parancsot:

    azure rediscache create [--name <name> --resource-group <resource-group> --location <location> [options]]

A paranccsal kapcsolatos további információkért futtassa a azure rediscache create -h parancsot.

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)

Meglévő Azure Cache for Redis törlése

Egy Azure Cache for Redis törléséhez használja a következő parancsot:

    azure rediscache delete [--name <name> --resource-group <resource-group> ]

A paranccsal kapcsolatos további információkért futtassa a azure rediscache delete -h parancsot.

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)

Az előfizetésen vagy erőforráscsoporton belüli összes Azure Cache for Redis listázása

Az előfizetésen vagy erőforráscsoporton belüli összes Azure Cache for Redis az alábbi paranccsal listázhatja:

    azure rediscache list [options]

A paranccsal kapcsolatos további információkért futtassa a azure rediscache list -h parancsot.

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)

Meglévő Azure Cache for Redis tulajdonságainak megjelenítése

Meglévő Azure Cache for Redis tulajdonságainak megjelenítéséhez használja az alábbi parancsot:

    azure rediscache show [--name <name> --resource-group <resource-group>]

A paranccsal kapcsolatos további információkért futtassa a azure rediscache show -h parancsot.

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)

Meglévő Azure Cache for Redis beállításainak módosítása

Meglévő Azure Cache for Redis beállításainak módosításához használja a következő parancsot:

    azure rediscache set [--name <name> --resource-group <resource-group> --redis-configuration <redis-configuration>/--redis-configuration-file <redisConfigurationFile>]

A paranccsal kapcsolatos további információkért futtassa a azure rediscache set -h parancsot.

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)

Meglévő Azure Cache for Redis hitelesítési kulcsának megújítása

Meglévő Azure Cache for Redis hitelesítési kulcsának megújításához használja a következő parancsot:

    azure rediscache renew-key [--name <name> --resource-group <resource-group> --key-type <key-type>]

Adja meg Primary a vagy Secondary a értéket.key-type

A paranccsal kapcsolatos további információkért futtassa a azure rediscache renew-key -h parancsot.

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)

Meglévő Azure Cache for Redis elsődleges és másodlagos kulcsainak listázása

Meglévő Azure Cache for Redis elsődleges és másodlagos kulcsainak listázásához használja a következő parancsot:

    azure rediscache list-keys [--name <name> --resource-group <resource-group>]

A paranccsal kapcsolatos további információkért futtassa a azure rediscache list-keys -h parancsot.

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)