← 返回命令列表

Linux command

az-redis 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Create a Redis cache

az redis create --name [MyCache] --resource-group [MyResourceGroup] --location [eastus] --sku [Basic] --vm-size [c0]

List all Redis caches

az redis list --resource-group [MyResourceGroup]

Show details

az redis show --name [MyCache] --resource-group [MyResourceGroup]

List access keys

az redis list-keys --name [MyCache] --resource-group [MyResourceGroup]

Regenerate access keys

az redis regenerate-keys --name [MyCache] --resource-group [MyResourceGroup] --key-type [Primary]

Update cache settings

az redis update --name [MyCache] --resource-group [MyResourceGroup] --set redisConfiguration.maxmemory-policy=allkeys-lru

Force reboot

az redis force-reboot --name [MyCache] --resource-group [MyResourceGroup] --reboot-type [AllNodes]

Flush all keys

az redis flush --name [MyCache] --resource-group [MyResourceGroup] --yes

Delete a Redis cache

az redis delete --name [MyCache] --resource-group [MyResourceGroup] --yes

说明

az redis manages Azure Cache for Redis, a fully managed in-memory data store based on Redis. It provides low-latency, high-throughput caching for applications. Available SKUs are Basic (single node), Standard (replicated), and Premium (clustering, persistence, virtual network support).

参数

--name -n
Name of the Redis cache.
--resource-group -g
Name of resource group.
--sku
SKU tier: Basic, Standard, or Premium.
--vm-size
Size of the Redis cache to deploy. Basic and Standard sizes start with c (c0-c6). Premium sizes start with p (p1-p5).
--location -l
Location of the cache.
--minimum-tls-version
Specifies the TLS version required by clients to connect to cache (1.0, 1.1, 1.2).
--redis-version
Redis version in the form 'major.minor' or 'latest'. Default value is 'latest'.
--yes -y
Do not prompt for confirmation (used with delete and flush).

FAQ

What is the az-redis command used for?

az redis manages Azure Cache for Redis, a fully managed in-memory data store based on Redis. It provides low-latency, high-throughput caching for applications. Available SKUs are Basic (single node), Standard (replicated), and Premium (clustering, persistence, virtual network support).

How do I run a basic az-redis example?

Run `az redis create --name [MyCache] --resource-group [MyResourceGroup] --location [eastus] --sku [Basic] --vm-size [c0]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does --name -n do in az-redis?

Name of the Redis cache.