不同版本的 Redis Cluster 实例对 Redis 命令的支持度有所不同。
注释与说明
为便于阅读和内容表达,本文的表格约定使用下述注释:
- ✓ 表示支持该命令。
- ✕ 表示在不支持该命令。
- ⎻ 表示在原生Redis的该版本下,该命令尚未开始支持。
- config 表示支持该命令,但需要在控制台修改控制参数支持。
Cluster 命令族
命令 |
4.0版本 |
5.0版本 |
6.x版本 |
CLUSTER ADDSLOTS |
✓ |
✓ |
✓ |
CLUSTER BUMPEPOCH |
✓ |
✓ |
✓ |
CLUSTER COUNT-FAILURE-REPORTS |
✓ |
✓ |
✓ |
CLUSTER COUNTKEYSINSLOT |
✓ |
✓ |
✓ |
CLUSTER DELSLOTS |
✓ |
✓ |
✓ |
CLUSTER FAILOVER |
✓ |
✓ |
✓ |
CLUSTER FLUSHSLOTS |
✓ |
✓ |
✓ |
CLUSTER FORGET |
✓ |
✓ |
✓ |
CLUSTER GETKEYSINSLOT |
✓ |
✓ |
✓ |
CLUSTER INFO |
✓ |
✓ |
✓ |
CLUSTER KEYSLOT |
✓ |
✓ |
✓ |
CLUSTER MEET |
✓ |
✓ |
✓ |
CLUSTER MYID |
✓ |
✓ |
✓ |
CLUSTER NODES |
✓ |
✓ |
✓ |
CLUSTER REPLICAS |
⎻ |
✓ |
✓ |
CLUSTER REPLICATE |
✓ |
✓ |
✓ |
CLUSTER RESET |
✓ |
✓ |
✓ |
CLUSTER SAVECONFIG |
✓ |
✓ |
✓ |
CLUSTER SET-CONFIG-EPOCH |
✓ |
✓ |
✓ |
CLUSTER SETSLOT |
✓ |
✓ |
✓ |
CLUSTER SLAVES |
✓ |
✓ |
✓ |
CLUSTER SLOTS |
✓ |
✓ |
✓ |
READONLY |
✓ |
✓ |
✓ |
READWRITE |
✓ |
✓ |
✓ |
Connection 命令族
命令 |
4.0版本 |
5.0版本 |
6.x版本 |
AUTH |
✓ |
✓ |
✓ |
CLIENT CACHING |
⎻ |
⎻ |
✓ |
CLIENT GETNAME |
✓ |
✓ |
✓ |
CLIENT GETREDIR |
⎻ |
⎻ |
✓ |
CLIENT ID |
⎻ |
✓ |
✓ |
CLIENT KILL |
✓ |
✓ |
✓ |
CLIENT LIST |
✓ |
✓ |
✓ |
CLIENT PAUSE |
✓ |
✓ |
✓ |
CLIENT REPLY |
✓ |
✓ |
✓ |
CLIENT SETNAME |
✓ |
✓ |
✓ |
CLIENT TRACKING |
⎻ |
⎻ |
✓ |
CLIENT UNBLOCK |
⎻ |
✓ |
✓ |
ECHO |
✓ |
✓ |
✓ |
HELLO |
⎻ |
⎻ |
✓ |
PING |
✓ |
✓ |
✓ |
QUIT |
✓ |
✓ |
✓ |
SELECT |
✓ |
✓ |
✓ |
Geo 命令族
命令 |
4.0版本 |
5.0版本 |
6.x版本 |
GEOADD |
✓ |
✓ |
✓ |
GEODIST |
✓ |
✓ |
✓ |
GEOHASH |
✓ |
✓ |
✓ |
GEOPOS |
✓ |
✓ |
✓ |
GEORADIUS |
✓ |
✓ |
✓ |
GEORADIUSBYMEMBER |
✓ |
✓ |
✓ |
Hashes 命令族
命令 |
4.0版本 |
5.0版本 |
6.x版本 |
HDEL |
✓ |
✓ |
✓ |
HEXISTS |
✓ |
✓ |
✓ |
HGET |
✓ |
✓ |
✓ |
HGETALL |
✓ |
✓ |
✓ |
HINCRBY |
✓ |
✓ |
✓ |
HINCRBYFLOAT |
✓ |
✓ |
✓ |
HKEYS |
✓ |
✓ |
✓ |
HLEN |
✓ |
✓ |
✓ |
HMGET |
✓ |
✓ |
✓ |
HMSET |
✓ |
✓ |
✓ |
HSCAN |
✓ |
✓ |
✓ |
HSET |
✓ |
✓ |
✓ |
HSETNX |
✓ |
✓ |
✓ |
HSTRLEN |
✓ |
✓ |
✓ |
HVALS |
✓ |
✓ |
✓ |
HyperLogLog 命令族
命令 |
4.0版本 |
5.0版本 |
6.x版本 |
PFADD |
✓ |
✓ |
✓ |
PFCOUNT |
✓ |
✓ |
✓ |
PFMERGE |
✓ |
✓ |
✓ |
Keys 命令族
命令 |
4.0版本 |
5.0版本 |
6.x版本 |
DEL |
✓ |
✓ |
✓ |
DUMP |
✓ |
✓ |
✓ |
EXISTS |
✓ |
✓ |
✓ |
EXPIRE |
✓ |
✓ |
✓ |
EXPIREAT |
✓ |
✓ |
✓ |
KEYS |
✓ |
config |
config |
MIGRATE |
✓ |
✓ |
✓ |
MOVE |
✓ |
✓ |
✓ |
OBJECT |
✓ |
✓ |
✓ |
PERSIST |
✓ |
✓ |
✓ |
PEXPIRE |
✓ |
✓ |
✓ |
PEXPIREAT |
✓ |
✓ |
✓ |
PTTL |
✓ |
✓ |
✓ |
RANDOMKEY |
✓ |
✓ |
✓ |
RENAME |
✓ |
✓ |
✓ |
RENAMENX |
✓ |
✓ |
✓ |
RESTORE |
✓ |
✓ |
✓ |
SCAN |
✓ |
✓ |
✓ |
SORT |
✓ |
✓ |
✓ |
TOUCH |
✓ |
✓ |
✓ |
TTL |
✓ |
✓ |
✓ |
TYPE |
✓ |
✓ |
✓ |
UNLINK |
✓ |
✓ |
✓ |
WAIT |
✓ |
✓ |
✓ |
Lists 命令族
命令 |
4.0版本 |
5.0版本 |
6.x版本 |
BLPOP |
✓ |
✓ |
✓ |
BRPOP |
✓ |
✓ |
✓ |
BRPOPLPUSH |
✓ |
✓ |
✓ |
LINDEX |
✓ |
✓ |
✓ |
LINSERT |
✓ |
✓ |
✓ |
LLEN |
✓ |
✓ |
✓ |
LPOP |
✓ |
✓ |
✓ |
LPUSH |
✓ |
✓ |
✓ |
LPUSHX |
✓ |
✓ |
✓ |
LRANGE |
✓ |
✓ |
✓ |
LREM |
✓ |
✓ |
✓ |
LSET |
✓ |
✓ |
✓ |
LTRIM |
✓ |
✓ |
✓ |
RPOP |
✓ |
✓ |
✓ |
RPOPLPUSH |
✓ |
✓ |
✓ |
RPUSH |
✓ |
✓ |
✓ |
RPUSHX |
✓ |
✓ |
✓ |
Pub 和 Sub 命令族
命令 |
4.0版本 |
5.0版本 |
6.x版本 |
PSUBSCRIBE |
✓ |
✓ |
✓ |
PUBLISH |
✓ |
✓ |
✓ |
PUBSUB |
✓ |
✓ |
✓ |
PUNSUBSCRIBE |
✓ |
✓ |
✓ |
SUBSCRIBE |
✓ |
✓ |
✓ |
UNSUBSCRIBE |
✓ |
✓ |
✓ |
Scripting 命令族
命令 |
4.0版本 |
5.0版本 |
6.x版本 |
EVAL |
✓ |
✓ |
✓ |
EVALSHA |
✓ |
✓ |
✓ |
SCRIPT DEBUG |
✓ |
✓ |
✓ |
SCRIPT EXISTS |
✓ |
✓ |
✓ |
SCRIPT FLUSH |
✓ |
✓ |
✓ |
SCRIPT KILL |
✓ |
✓ |
✓ |
SCRIPT LOAD |
✓ |
✓ |
✓ |
Sentinel 命令族
命令 |
4.0版本 |
5.0版本 |
6.x版本 |
SENTINEL sentinels |
✓ |
✓ |
✓ |
SENTINEL get-master-addr-by-name |
✓ |
✓ |
✓ |
Server 命令族
⚠️注意
Redis6.x 版本屏蔽了ACL 命令,但 AppCenter 控制台已经实现了ACL访问控制功能。
命令 |
4.0版本 |
5.0版本 |
6.0版本 |
ACL CAT |
⎻ |
⎻ |
config |
ACL DELUSER |
⎻ |
⎻ |
config |
ACL GENPASS |
⎻ |
⎻ |
config |
ACL GETUSER |
⎻ |
⎻ |
config |
ACL HELP |
⎻ |
⎻ |
config |
ACL LIST |
⎻ |
⎻ |
config |
ACL LOAD |
⎻ |
⎻ |
config |
ACL LOG |
⎻ |
⎻ |
config |
ACL SAVE |
⎻ |
⎻ |
config |
ACL SETUSER |
⎻ |
⎻ |
config |
ACL USERS |
⎻ |
⎻ |
config |
ACL WHOAMI |
⎻ |
⎻ |
config |
BGREWRITEAOF |
config |
config |
config |
BGSAVE |
config |
config |
config |
COMMAND |
✓ |
✓ |
✓ |
COMMAND COUNT |
✓ |
✓ |
✓ |
COMMAND GETKEYS |
✓ |
✓ |
✓ |
COMMAND INFO |
✓ |
✓ |
✓ |
CONFIG GET |
config |
config |
config |
CONFIG RESETSTAT |
config |
config |
config |
CONFIG REWRITE |
config |
config |
config |
CONFIG SET |
config |
config |
config |
DBSIZE |
✓ |
✓ |
✓ |
DEBUG OBJECT |
config |
config |
config |
DEBUG SEGFAULT |
config |
config |
config |
FLUSHALL |
✓ |
config |
config |
FLUSHDB |
✓ |
config |
config |
INFO |
✓ |
✓ |
✓ |
LASTSAVE |
✓ |
✓ |
✓ |
LATENCY DOCTOR |
✓ |
✓ |
✓ |
LATENCY GRAPH |
✓ |
✓ |
✓ |
LATENCY HELP |
✓ |
✓ |
✓ |
LATENCY HISTORY |
✓ |
✓ |
✓ |
LATENCY LATEST |
✓ |
✓ |
✓ |
LATENCY RESET |
✓ |
✓ |
✓ |
LOLWUT |
⎻ |
✓ |
✓ |
MEMORY DOCTOR |
✓ |
✓ |
✓ |
MEMORY HELP |
✓ |
✓ |
✓ |
MEMORY MALLOC⎻ STATS |
✓ |
✓ |
✓ |
MEMORY PURGE |
✓ |
✓ |
✓ |
MEMORY STATS |
✓ |
✓ |
✓ |
MEMORY USAGE |
✓ |
✓ |
✓ |
MODULE LIST |
✓ |
✓ |
✓ |
MODULE LOAD |
✓ |
✓ |
✓ |
MODULE UNLOAD |
✓ |
✓ |
✓ |
MONITOR |
✓ |
✓ |
✓ |
PSYNC |
✓ |
✓ |
✓ |
REPLICAOF |
⎻ |
config |
config |
ROLE |
✓ |
✓ |
✓ |
SAVE |
config |
config |
config |
SHUTDOWN |
config |
config |
config |
SLAVEOF |
config |
config |
config |
SLOWLOG |
✓ |
✓ |
✓ |
SWAPDB |
✓ |
✓ |
✓ |
SYNC |
✓ |
✓ |
✓ |
TIME |
✓ |
✓ |
✓ |
Sets 命令族
命令 |
4.0版本 |
5.0版本 |
6.0版本 |
SADD |
✓ |
✓ |
✓ |
SCARD |
✓ |
✓ |
✓ |
SDIFF |
✓ |
✓ |
✓ |
SDIFFSTORE |
✓ |
✓ |
✓ |
SINTER |
✓ |
✓ |
✓ |
SINTERSTORE |
✓ |
✓ |
✓ |
SISMEMBER |
✓ |
✓ |
✓ |
SMEMBERS |
✓ |
✓ |
✓ |
SMISMEMBER |
✓ |
✓ |
✓ ️ |
SMOVE |
✓ |
✓ |
✓ |
SPOP |
✓ |
✓ |
✓ |
SRANDMEMBER |
✓ |
✓ |
✓ |
SREM |
✓ |
✓ |
✓ |
SSCAN |
✓ |
✓ |
✓ |
SUNION |
✓ |
✓ |
✓ |
SUNIONSTORE |
✓ |
✓ |
✓ |
Sorted Sets 命令族
命令 |
4.0版本 |
5.0版本 |
6.0版本 |
BZPOPMAX |
⎻ |
✓ |
✓ |
BZPOPMIN |
⎻ |
✓ |
✓ |
ZADD |
✓ |
✓ |
✓ |
ZCARD |
✓ |
✓ |
✓ |
ZCOUNT |
✓ |
✓ |
✓ |
ZINCRBY |
✓ |
✓ |
✓ |
ZINTERSTORE |
✓ |
✓ |
✓ |
ZLEXCOUNT |
✓ |
✓ |
✓ |
ZPOPMAX |
⎻ |
✓ |
✓ |
ZPOPMIN |
⎻ |
✓ |
✓ |
ZRANGE |
✓ |
✓ |
✓ |
ZRANGEBYLEX |
✓ |
✓ |
✓ |
ZRANGEBYSCORE |
✓ |
✓ |
✓ |
ZRANK |
✓ |
✓ |
✓ |
ZREM |
✓ |
✓ |
✓ |
ZREMRANGEBYLEX |
✓ |
✓ |
✓ |
ZREMRANGEBYRANK |
✓ |
✓ |
✓ |
ZREMRANGEBYSCORE |
✓ |
✓ |
✓ |
ZREVRANGE |
✓ |
✓ |
✓ |
ZREVRANGEBYLEX |
✓ |
✓ |
✓ |
ZREVRANGEBYSCORE |
✓ |
✓ |
✓ |
ZREVRANK |
✓ |
✓ |
✓ |
ZSCAN |
✓ |
✓ |
✓ |
ZSCORE |
✓ |
✓ |
✓ |
ZUNIONSTORE |
✓ |
✓ |
✓ |
Streams 命令族
命令 |
4.0版本 |
5.0版本 |
6.0版本 |
XACK |
⎻ |
✓ |
✓ |
XADD |
⎻ |
✓ |
✓ |
XCLAIM |
⎻ |
✓ |
✓ |
XDEL |
⎻ |
✓ |
✓ |
XGROUP |
⎻ |
✓ |
✓ |
XINFO |
⎻ |
✓ |
✓ |
XLEN |
⎻ |
✓ |
✓ |
XPENDING |
⎻ |
✓ |
✓ |
XRANGE |
⎻ |
✓ |
✓ |
XREAD |
⎻ |
✓ |
✓ |
XREADGROUP |
⎻ |
✓ |
✓ |
XREVRANGE |
⎻ |
✓ |
✓ |
XTRIM |
⎻ |
✓ |
✓ |
Strings 命令族
命令 |
4.0版本 |
5.0版本 |
6.0版本 |
APPEND |
✓ |
✓ |
✓ |
BITCOUNT |
✓ |
✓ |
✓ |
BITFIELD |
✓ |
✓ |
✓ |
BITOP |
✓ |
✓ |
✓ |
BITPOS |
✓ |
✓ |
✓ |
DECR |
✓ |
✓ |
✓ |
DECRBY |
✓ |
✓ |
✓ |
GET |
✓ |
✓ |
✓ |
GETBIT |
✓ |
✓ |
✓ |
GETRANGE |
✓ |
✓ |
✓ |
GETSET |
✓ |
✓ |
✓ |
INCR |
✓ |
✓ |
✓ |
INCRBY |
✓ |
✓ |
✓ |
INCRBYFLOAT |
✓ |
✓ |
✓ |
MGET |
✓ |
✓ |
✓ |
MSET |
✓ |
✓ |
✓ |
MSETNX |
✓ |
✓ |
✓ |
PSETEX |
✓ |
✓ |
✓ |
SET |
✓ |
✓ |
✓ |
SETBIT |
✓ |
✓ |
✓ |
SETEX |
✓ |
✓ |
✓ |
SETNX |
✓ |
✓ |
✓ |
SETRANGE |
✓ |
✓ |
✓ |
STRALGO |
⎻ |
- |
✓ |
STRLEN |
✓ |
✓ |
✓ |
Transaction 命令族
命令 |
4.0版本 |
5.0版本 |
6.0版本 |
DISCARD |
✓ |
✓ |
✓ |
EXEC |
✓ |
✓ |
✓ |
MULTI |
✓ |
✓ |
✓ |
UNWATCH |
✓ |
✓ |
✓ |
WATCH |
✓ |
✓ |
✓ |