Redis 4.0支持及禁用的命令
华为云DCS Redis 4.0基于开源4.0.14版本进行开发,兼容开源的协议和命令。本章节主要介绍DCS Redis 4.0命令的兼容性,包括支持命令列表,禁用命令列表。
DCS Redis缓存实例支持Redis的绝大部分命令,任何兼容Redis协议的客户端都可以访问DCS。
- 因安全原因,部分Redis命令在分布式缓存服务中被禁用,具体请见Redis 4.0禁用的命令。
- DCS集群实例支持多个key,但不支持跨slot访问的Redis命令列表,如实例受限使用命令所示。
- 部分Redis命令使用时有限制,例如KEYS、FLUSHDB、FLUSHALL等,具体请见部分命令使用限制。
- 部分高危命令支持命令重命名,具体请见支持重命名的命令。
Redis 4.0支持的命令
各个命令的具体详细语法请前往Redis官方网站查看,例如您想了解SCAN命令的使用,可在Redis官方网站中搜索框中输入“SCAN”查询详细介绍。
- Redis高版本的命令,在低版本中不被兼容。判断DCS Redis是否支持某个命令,可通过在Redis-cli执行该命令,如果得到(error)ERR unknown command ‘xxx’的提示,则说明不支持该命令。
- Redis 4.0 Cluster版本集群实例使用pipeline时,要确保管道中的命令都能在同一分片执行。
DEL |
APPEND |
HDEL |
BLPOP |
SADD |
ZADD |
FLUSHALL |
DUMP |
BITCOUNT |
HEXISTS |
BRPOP |
SCARD |
ZCARD |
FLUSHDB |
EXISTS |
BITOP |
HGET |
BRPOPLRUSH |
SDIFF |
ZCOUNT |
DBSIZE |
EXPIRE |
BITPOS |
HGETALL |
LINDEX |
SDIFFSTORE |
ZINCRBY |
TIME |
MOVE |
DECR |
HINCRBY |
LINSERT |
SINTER |
ZRANGE |
INFO |
PERSIST |
DECRBY |
HINCRBYFLOAT |
LLEN |
SINTERSTORE |
ZRANGEBYSCORE |
CLIENT KILL |
PTTL |
GET |
HKEYS |
LPOP |
SISMEMBER |
ZRANK |
CLIENT LIST |
RANDOMKEY |
GETRANGE |
HMGET |
LPUSHX |
SMEMBERS |
ZREMRANGEBYRANK |
CLIENT GETNAME |
RENAME |
GETSET |
HMSET |
LRANGE |
SMOVE |
ZREMRANGEBYCORE |
CLIENT SETNAME |
RENAMENX |
INCR |
HSET |
LREM |
SPOP |
ZREVRANGE |
CONFIG GET |
RESTORE |
INCRBY |
HSETNX |
LSET |
SRANDMEMBER |
ZREVRANGEBYSCORE |
MONITOR |
SORT |
INCRBYFLOAT |
HVALS |
LTRIM |
SREM |
ZREVRANK |
SLOWLOG |
TTL |
MGET |
HSCAN |
RPOP |
SUNION |
ZSCORE |
ROLE |
TYPE |
MSET |
HSTRLEN |
RPOPLPU |
SUNIONSTORE |
ZUNIONSTORE |
SWAPDB |
SCAN |
MSETNX |
HLEN |
RPOPLPUSH |
SSCAN |
ZINTERSTORE |
MEMORY |
OBJECT |
PSETEX |
- |
RPUSH |
- |
ZSCAN |
CONFIG |
PEXPIRE |
SET |
- |
RPUSHX |
- |
ZRANGEBYLEX |
COMMAND |
PEXPIREAT |
SETBIT |
- |
LPUSH |
- |
ZLEXCOUNT |
- |
KEYS |
SETEX |
- |
- |
- |
ZREMRANGEBYSCORE |
- |
- |
SETNX |
- |
- |
- |
ZREM |
- |
- |
SETRANGE |
- |
- |
- |
- |
- |
- |
STRLEN |
- |
- |
- |
- |
- |
- |
BITFIELD |
- |
- |
- |
- |
- |
PFADD |
PSUBSCRIBE |
DISCARD |
AUTH |
EVAL |
GEOADD |
PFCOUNT |
PUBLISH |
EXEC |
ECHO |
EVALSHA |
GEOHASH |
PFMERGE |
PUBSUB |
MULTI |
PING |
SCRIPT EXISTS |
GEOPOS |
- |
PUNSUBSCRIBE |
UNWATCH |
QUIT |
SCRIPT FLUSH |
GEODIST |
- |
SUBSCRIBE |
WATCH |
SELECT(Cluster集群实例不支持) |
SCRIPT KILL |
GEORADIUS |
- |
UNSUBSCRIBE |
- |
- |
SCRIPT LOAD |
GEORADIUSBYMEMBER |
DEL |
APPEND |
HDEL |
BLPOP |
SADD |
ZADD |
FLUSHALL (不支持FLUSHALL SYNC) |
DUMP |
BITCOUNT |
HEXISTS |
BRPOP |
SCARD |
ZCARD |
FLUSHDB |
EXISTS |
BITOP |
HGET |
BRPOPLRUSH |
SDIFF |
ZCOUNT |
DBSIZE |
EXPIRE |
BITPOS |
HGETALL |
LINDEX |
SDIFFSTORE |
ZINCRBY |
TIME |
MOVE |
DECR |
HINCRBY |
LINSERT |
SINTER |
ZRANGE |
INFO |
PERSIST |
DECRBY |
HINCRBYFLOAT |
LLEN |
SINTERSTORE |
ZRANGEBYSCORE |
ROLE |
PTTL |
GET |
HKEYS |
LPOP |
SISMEMBER |
ZRANK |
MEMORY |
RENAME |
GETRANGE |
HMGET |
LPUSHX |
SMEMBERS |
ZREMRANGEBYRANK |
COMMAND |
RENAMENX |
GETSET |
HMSET |
LRANGE |
SMOVE |
ZREMRANGEBYCORE |
COMMAND COUNT |
RESTORE |
INCR |
HSET |
LREM |
SPOP |
ZREVRANGE |
COMMAND GETKEYS |
SORT |
INCRBY |
HSETNX |
LSET |
SRANDMEMBER |
ZREVRANGEBYSCORE |
COMMAND INFO |
TTL |
INCRBYFLOAT |
HVALS |
LTRIM |
SREM |
ZREVRANK |
CONFIG GET |
TYPE |
MGET |
HSCAN |
RPOP |
SUNION |
ZSCORE |
CONFIG RESETSTAT |
SCAN |
MSET |
HSTRLEN |
RPOPLPUSH |
SUNIONSTORE |
ZUNIONSTORE |
CONFIG REWRITE |
OBJECT |
MSETNX |
HLEN |
RPUSH |
SSCAN |
ZINTERSTORE |
CONFIG SET |
PEXPIRE |
PSETEX |
HKEYS |
RPUSHX |
- |
ZSCAN |
- |
PEXPIREAT |
SET |
- |
LPUSH |
- |
ZRANGEBYLEX |
- |
EXPIREAT |
SETBIT |
- |
- |
- |
ZLEXCOUNT |
- |
KEYS |
SETEX |
- |
- |
- |
ZREMRANGEBYSCORE |
- |
TOUCH |
SETNX |
- |
- |
- |
ZREM |
- |
UNLINK |
SETRANGE |
- |
- |
- |
ZREMRANGEBYLEX |
- |
RANDOMKEY |
STRLEN |
- |
- |
- |
ZREVRANGEBYLEX |
- |
- |
BITFIELD |
- |
- |
- |
- |
- |
- |
GETBIT |
- |
- |
- |
- |
- |
PFADD |
PSUBSCRIBE |
DISCARD |
AUTH |
EVAL |
GEOADD |
CLUSTER INFO |
PFCOUNT |
PUBLISH |
EXEC |
ECHO |
EVALSHA |
GEOHASH |
CLUSTER NODES |
PFMERGE |
PUBSUB |
MULTI |
PING |
SCRIPT EXISTS |
GEOPOS |
CLUSTER SLOTS |
- |
PUNSUBSCRIBE |
UNWATCH |
QUIT |
SCRIPT FLUSH |
GEODIST |
CLUSTER ADDSLOTS |
- |
SUBSCRIBE |
WATCH |
SELECT |
SCRIPT KILL |
GEORADIUS |
ASKING |
- |
UNSUBSCRIBE |
- |
CLIENT KILL |
SCRIPT LOAD |
GEORADIUSBYMEMBER |
READONLY |
- |
- |
- |
CLIENT LIST |
SCRIPT DEBUG YES|SYNC|NO |
GEOSEARCH |
READWRITE |
- |
- |
- |
CLIENT GETNAME |
- |
GEOSEARCHSTORE |
- |
- |
- |
- |
CLIENT SETNAME |
- |
- |
- |
上表中的Cluster类命令,仅2022/9/1日及之后创建的proxy集群实例支持。
DEL |
APPEND |
HDEL |
BLPOP |
SADD |
ZADD |
FLUSHALL (不支持FLUSHALL SYNC) |
DUMP |
BITCOUNT |
HEXISTS |
BRPOP |
SCARD |
ZCARD |
FLUSHDB |
EXISTS |
BITOP |
HGET |
BRPOPLRUSH |
SDIFF |
ZCOUNT |
DBSIZE |
EXPIRE |
BITPOS |
HGETALL |
LINDEX |
SDIFFSTORE |
ZINCRBY |
TIME |
MOVE |
DECR |
HINCRBY |
LINSERT |
SINTER |
ZRANGE |
INFO |
PERSIST |
DECRBY |
HINCRBYFLOAT |
LLEN |
SINTERSTORE |
ZRANGEBYSCORE |
MONITOR |
PTTL |
GET |
HKEYS |
LPOP |
SISMEMBER |
ZRANK |
SLOWLOG |
RANDOMKEY |
GETRANGE |
HMGET |
LPUSHX |
SMEMBERS |
ZREMRANGEBYRANK |
ROLE |
RENAME |
GETSET |
HMSET |
LRANGE |
SMOVE |
ZREMRANGEBYCORE |
SWAPDB |
RENAMENX |
INCR |
HSET |
LREM |
SPOP |
ZREVRANGE |
MEMORY |
RESTORE |
INCRBY |
HSETNX |
LSET |
SRANDMEMBER |
ZREVRANGEBYSCORE |
COMMAND |
SORT |
INCRBYFLOAT |
HVALS |
LTRIM |
SREM |
ZREVRANK |
COMMAND COUNT |
TTL |
MGET |
HSCAN |
RPOP |
SUNION |
ZSCORE |
COMMAND GETKEYS |
TYPE |
MSET |
HSTRLEN |
RPOPLPUSH |
SUNIONSTORE |
ZUNIONSTORE |
COMMAND INFO |
SCAN |
MSETNX |
HLEN |
RPUSH |
SSCAN |
ZINTERSTORE |
CONFIG GET |
OBJECT |
PSETEX |
- |
RPUSHX |
- |
ZSCAN |
CONFIG RESETSTAT |
PEXPIRE |
SET |
- |
LPUSH |
- |
ZRANGEBYLEX |
CONFIG REWRITE |
PEXPIREAT |
SETBIT |
- |
- |
- |
ZLEXCOUNT |
CONFIG SET |
EXPIREAT |
SETEX |
- |
- |
- |
ZREMRANGEBYSCORE |
- |
KEYS |
SETNX |
- |
- |
- |
ZREM |
- |
TOUCH |
SETRANGE |
- |
- |
- |
ZREMRANGEBYLEX |
- |
UNLINK |
STRLEN |
- |
- |
- |
ZREVRANGEBYLEX |
- |
- |
BITFIELD |
- |
- |
- |
- |
- |
- |
GETBIT |
- |
- |
- |
- |
- |
PFADD |
PSUBSCRIBE |
DISCARD |
AUTH |
EVAL |
GEOADD |
PFCOUNT |
PUBLISH |
EXEC |
ECHO |
EVALSHA |
GEOHASH |
PFMERGE |
PUBSUB |
MULTI |
PING |
SCRIPT EXISTS |
GEOPOS |
- |
PUNSUBSCRIBE |
UNWATCH |
QUIT |
SCRIPT FLUSH |
GEODIST |
- |
SUBSCRIBE |
WATCH |
SELECT |
SCRIPT KILL |
GEORADIUS |
- |
UNSUBSCRIBE |
- |
CLIENT KILL |
SCRIPT LOAD |
GEORADIUSBYMEMBER |
- |
- |
- |
CLIENT LIST |
SCRIPT DEBUG YES|SYNC|NO |
GEOSEARCH |
- |
- |
- |
CLIENT GETNAME |
- |
GEOSEARCHSTORE |
- |
- |
- |
CLIENT SETNAME |
- |
- |
Redis 4.0禁用的命令
以下列出了Redis 4.0实例禁用的命令。
MIGRATE |
SLAVEOF |
- |
SHUTDOWN |
- |
LASTSAVE |
- |
DEBUG相关类 |
- |
SAVE |
- |
BGSAVE |
- |
BGREWRITEAOF |
- |
SYNC |
- |
PSYNC |
MIGRATE |
BGREWRITEAOF |
BZPOPMAX |
MOVE |
BGSAVE |
BZPOPMIN |
WAIT |
CLIENT相关命令 |
ZPOPMAX |
- |
DEBUG OBJECT |
ZPOPMIN |
- |
DEBUG SEGFAULT |
- |
- |
LASTSAVE |
- |
- |
PSYNC |
- |
- |
SAVE |
- |
- |
SHUTDOWN |
- |
- |
SLAVEOF |
- |
- |
LATENCY相关命令 |
- |
- |
MODULE相关命令 |
- |
- |
LOLWUT |
- |
- |
SWAPDB |
- |
- |
REPLICAOF |
- |
- |
SYNC |
- |
MIGRATE |
SLAVEOF |
CLUSTER MEET |
- |
SHUTDOWN |
CLUSTER FLUSHSLOTS |
- |
LASTSAVE |
CLUSTER ADDSLOTS |
- |
DEBUG相关类 |
CLUSTER DELSLOTS |
- |
SAVE |
CLUSTER SETSLOT |
- |
BGSAVE |
CLUSTER BUMPEPOCH |
- |
BGREWRITEAOF |
CLUSTER SAVECONFIG |
- |
SYNC |
CLUSTER FORGET |
- |
PSYNC |
CLUSTER REPLICATE |
- |
- |
CLUSTER COUNT-FAILURE-REPORTS |
- |
- |
CLUSTER FAILOVER |
- |
- |
CLUSTER SET-CONFIG-EPOCH |
- |
- |
CLUSTER RESET |
MIGRATE |
BGREWRITEAOF |
BZPOPMAX |
WAIT |
BGSAVE |
BZPOPMIN |
- |
DEBUG OBJECT |
ZPOPMAX |
- |
DEBUG SEGFAULT |
ZPOPMIN |
- |
LASTSAVE |
- |
- |
LOLWUT |
- |
- |
MODULE LIST/LOAD/UNLOAD |
- |
- |
PSYNC |
- |
- |
REPLICAOF |
- |
- |
SAVE |
- |
- |
SHUTDOWN [NOSAVE|SAVE] |
- |
- |
SLAVEOF |
- |
- |
SWAPDB |
- |
- |
SYNC |
- |
支持重命名的命令
支持重命名的命令 |
command、keys、flushdb、flushall、hgetall、scan、hscan、sscan、和zscan Proxy集群实例还支持dbsize和dbstats命令重命名,其他命令暂时不支持。 |
---|---|
重命名的方式 |
请参考命令重命名。 |