This topic describes the limits on the commands supported by cluster instances. Cluster instances and standard instances have different architectures and follow different rules to run Redis commands.
Supported commands
- For more information about the commands supported by cluster instances of Community Edition, see Commands supported by Community Edition.
- ApsaraDB for Redis Enhanced Edition (Tair) has released a variety of instances for various scenarios. These instances follow different rules to run Redis commands. For more information, see Limits on commands supported by Enhanced Edition.
Unsupported commands
- SWAPDB
- CLIENT ID
Limited commands
Note To run the following limited commands on cluster instances, use hash tags to make
sure that all keys are in a hash slot. For more information, see Redis documentation.
Command group | Command |
---|---|
HyperLogLog | PFMERGE and PFCOUNT |
Keys | RENAME, RENAMENX, and SORT |
Lists | RPOPLPUSH, BRPOP, BLPOP, and BRPOPLPUSH |
Scripting | EVAL, EVALSHA, SCRIPT EXISTS, SCRIPT FLUSH, SCRIPT KILL, and SCRIPT LOAD |
Strings | MSETNX |
Transaction | DISCARD, EXEC, MULTI, UNWATCH, and WATCH |
Other limits
- You can run the CLIENT LIST command to list all connections to the proxy node. The
following list shows the response parameters:
- The following response parameters are the same as those in native Redis:
id
,age
,idle
,addr
,fd
,name
,db
,multi
,omem
, andcmd
. - The values of the
sub
andpsub
parameters on the proxy node are both 1 or 0. - The
qbuf
,qbuf-free
,obl
, andoll
parameters can be ignored.
- The following response parameters are the same as those in native Redis:
- You can run the CLIENT KILL command in the following ways:
client kill ip:port
andclient kill addr ip:port
. - If you do not run the WATCH command before a transaction is executed, and each command
in the transaction processes only one key, the keys processed by all commands can
be distributed in different slots. You can run these commands in the same way as you
run them in a database that is connected without a proxy server. In other scenarios,
all keys that all commands process in a transaction must be in the same slot.
- The commands that process multiple keys include: DEL, SORT, MGET, MSET, BITOP, EXISTS, MSETNX, RENAME, RENAMENX, BLPOP, BRPOP, RPOPLPUSH, BRPOPLPUSH, SMOVE, SUNION, SINTER, SDIFF, SUNIONSTORE, SINTERSTORE, SDIFFSTORE, ZUNIONSTORE, ZINTERSTORE, PFMERGE, and PFCOUNT.
- The commands that are not supported in transactions include: WATCH, UNWATCH, RANDOMKEY, KEYS, SUBSCRIBE, UNSUBSCRIBE, PSUBSCRIBE, PUNSUBSCRIBE, PUBLISH, PUBSUB, SCRIPT, EVAL, EVALSHA, SCAN, ISCAN, DBSIZE, ADMINAUTH, AUTH, PING, ECHO, FLUSHDB, FLUSHALL, MONITOR, IMONITOR, RIMONITOR, INFO, IINFO, RIINFO, CONFIG, SLOWLOG, TIME, and CLIENT.
- When you run Lua scripts on a cluster instance, follow these limits:
- You must use KEYS arrays to pass all keys. For Redis commands in
redis.call/pcall
, keys must be KEYS arrays. You cannot replace KEYS with Lua variables. Otherwise, the system returns an error: "-ERR bad lua script for redis cluster, all the keys that the script uses should be passed using the KEYS array\r\n
". - All keys must be in the same slot. Otherwise, the system returns an error: "
-ERR eval/evalsha command keys must be in same slot\r\n
". - You must use keys when you run Redis commands. Otherwise, the system returns an error:
"
-ERR for redis cluster, eval/evalsha number of keys can't be negative or zero\r\n
". - Pub/Sub commands are not supported, including PSUBSCRIBE, PUBSUB, PUBLISH, PUNSUBSCRIBE, SUBSCRIBE, and UNSUBSCRIBE.
- The UNPACK function is not supported.
- You must use KEYS arrays to pass all keys. For Redis commands in