- Redis 4.0、5.0、6.2标准架构与集群架构均支持 client list、client getname、client setname、command count、command info、config rewrite、config resetstat、role、lastsave、command、dbsize、info、time、config get、flushdb、flushall 命令。
- Redis 4.0、5.0、6.2、标准架构与集群架构均不支持 bgrewriteaof、bgsave、client kill、sync、psync、client pause、client reply、slaveof、config set、debug object、debug segfault、save、shutdown、module、acl cat、acl deluser、 acl genpass、acl getuser、acl help、acl list、acl load、acl log、acl save、acl setuser、acl users、acl whoami、failover 等命令。
- MEMORY 与 slowlog 命令仅支持4.0、5.0、6.2标准架构,不支持集群架构。
- cluster keyslot、cluster nodes、cluster getkeysinslot、cluster slots、cluster info、cluster countkeysinslot 均支持 Redis 4.0、5.0、6.2版本集群架构,不支持标准架构。cluster 其他命令都不支持。
- lolwut 命令在 Redis 5.0及以上版本的标准架构与集群架构才支持。
- monitor 命令在 Redis 6.2版本暂停支持,在6.2 之前版本支持。
**命令族** **命令** **新增说明** server 族 CONFIG SET/GET 新增参数,原子性的处理多个配置的 set、get。 Quit 标记为 deprecated,客户端可以直接关闭 TCP 连接。 SHUTDOWN [NOSAVE \| SAVE] [NOW] [FORCE] [ABORT] 新增 NOW \| FORCE \| ABORT。 - NOW:立即关闭,不等待任何正在进行的命令完成。
- FORCE:强制关闭 Redis 服务器,即使有命令正在执行。
- ABORT:终止正在执行的命令,而不执行任何其他命令。
COMMAND GETKEYSANDFLAGS command [arg [arg ...]] 新增命令,获取命令的 key 和 flag。 COMMAND DOCS [command-name [command-name ...]] 新增命令。返回命令的文档信息,包含历史更改等记录。 COMMAND LIST [FILTERBY <MODULE module-name \| ACLCAT category \| PATTERN pattern>] 新增命令。返回 Redis 命令列表。 COMMAND INFO 更新命令。返回 Redis 命令的信息。 INFO [section [section ...]] 新增参数。支持同时获取多个章节。 XGROUP CREATE key group <id \| $> [MKSTREAM] [ENTRIESREAD entries-read] 新增 ENTRIESREAD ,用于设置和开启 entries-read 和 lag 功能。 XGROUP SETID key group <id \| $> [ENTRIESREAD entries-read] 新增 ENTRIESREAD ,用于设置和开启 entries-read 和 lag 功能。
各版本支持的具体信息,请参见下表。✓ 表示支持,x 表示不支持,- 表示该命令不存在跨 Slot 访问的场景。
| 命令 | 4.0 内存版(标准架构) | 4.0 内存版(集群架构) | 5.0 内存版(标准架构) | 5.0 内存版(集群架构) | 6.2 内存版(标准架构) | 6.2 内存版(集群架构) | 内存版(集群架构)跨 Slot 支持 |
|---|---|---|---|---|---|---|---|
| bgrewriteaof | x | x | x | x | x | x | - |
| bgsave | x | x | x | x | x | x | - |
| client kill | x | x | x | x | x | x | - |
| sync | x | x | x | x | x | x | - |
| psync | x | x | x | x | x | x | - |
| client list | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | - |
| client getname | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | - |
| client pause | x | x | x | x | x | x | - |
| client reply | x | x | x | x | x | x | - |
| client setname | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | - |
| command count | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | - |
| command getkeys | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | - |
| command info | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | - |
| command getkegysandflags | x | x | x | x | x | x | - |
| command docs | x | x | x | x | x | x | - |
| command list | x | x | x | x | x | x | - |
| slaveof | x | x | x | x | x | x | - |
| config rewrite | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | - |
| config set | x | x | x | x | x | x | - |
| config resetstat | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | - |
| debug object | x | x | x | x | x | x | - |
| debug segfault | x | x | x | x | x | x | - |
| role | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | - |
| save | x | x | x | x | x | x | - |
| lastsave | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | - |
| shutdown | x | x | x | x | x | x | - |
| memory | ✓ | x | ✓ | x | ✓ | x | - |
| command | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | - |
| dbsize | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | - |
| info | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | - |
| time | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | - |
| config get | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | - |
| monitor | ✓ | ✓ | ✓ | ✓ | x | x | - |
| flushdb | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | - |
| flushall | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | - |
| slowlog | ✓ | x | ✓ | x | ✓ | x | - |
| cluster keyslot | x | ✓ | x | ✓ | x | ✓ | - |
| cluster nodes | x | ✓ | x | ✓ | x | ✓ | - |
| cluster getkeysinslot | x | ✓ | x | ✓ | x | ✓ | - |
| cluster slots | x | ✓ | x | ✓ | x | ✓ | - |
| cluster info | x | ✓ | x | ✓ | x | ✓ | - |
| cluster countkeysinslot | x | ✓ | x | ✓ | x | ✓ | - |
| cluster shards | x | x | x | x | x | x | - |
| cluster 其他 | x | x | x | x | x | x | - |
| module | x | x | x | x | x | x | - |
| lolwut | x | x | ✓ | ✓ | ✓ | ✓ | - |
| acl cat | x | x | x | x | x | x | - |
| acl deluser | x | x | x | x | x | x | - |
| acl genpass | x | x | x | x | x | x | - |
| acl help | x | x | x | x | x | x | - |
| acl list | x | x | x | x | x | x | - |
| acl load | x | x | x | x | x | x | - |
| acl log | x | x | x | x | x | x | - |
| acl save | x | x | x | x | x | x | - |
| acl setuser | x | x | x | x | x | x | - |
| acl users | x | x | x | x | x | x | - |
| acl whoami | x | x | x | x | x | x | - |
| failover | x | x | x | x | x | x | - |
| slowlog help | x | x | x | x | x | x | - |