CLUSTER SLOTS
相关命令
- BGREWRITEAOF
- BGSAVE
- CLIENT GETNAME
- CLIENT KILL
- CLIENT LIST
- CLIENT PAUSE
- CLIENT SETNAME
- CLUSTER SLOTS
- COMMAND
- COMMAND COUNT
- COMMAND GETKEYS
- COMMAND INFO
- CONFIG GET
- CONFIG RESETSTAT
- CONFIG REWRITE
- CONFIG SET
- DBSIZE
- DEBUG OBJECT
- DEBUG SEGFAULT
- FLUSHALL
- FLUSHDB
- INFO
- LASTSAVE
- MONITOR
- ROLE
- SAVE
- SHUTDOWN
- SLAVEOF
- SLOWLOG
- SYNC
- TIME
Available since 3.0.0.
时间复杂度: O(N) where N is the total number of Cluster nodes
Returns Array reply of current cluster state.
CLUSTER SLOTS
returns details about which cluster slots map to which Redis instances.
Nested Result Array
Each nested result is:
- Start slot range
- End slot range
- Master for slot range represented as nested IP/Port array
- First replica of master for slot range
- Second replica
- …continues until all replicas for this master are returned.
Each result includes all active replicas of the master instance for the listed slot range. Failed replicas are not returned.
The third nested reply is guaranteed to be the IP/Port pair of the master instance for the slot range. All IP/Port pairs after the third nested reply are replicas of the master.
If a cluster instance has non-contiguous slots (e.g. 1-400,900,1800-6000) then master and replica IP/Port results will be duplicated for each top-level slot range reply.
Sample Output
127.0.0.1:7001> cluster slots
1) 1) (integer) 0
2) (integer) 4095
3) 1) "127.0.0.1"
2) (integer) 7000
4) 1) "127.0.0.1"
2) (integer) 7004
2) 1) (integer) 12288
2) (integer) 16383
3) 1) "127.0.0.1"
2) (integer) 7003
4) 1) "127.0.0.1"
2) (integer) 7007
3) 1) (integer) 4096
2) (integer) 8191
3) 1) "127.0.0.1"
2) (integer) 7001
4) 1) "127.0.0.1"
2) (integer) 7005
4) 1) (integer) 8192
2) (integer) 12287
3) 1) "127.0.0.1"
2) (integer) 7002
4) 1) "127.0.0.1"
2) (integer) 7006
返回值
Array reply: nested list of slot ranges with IP/Port mappings.
This website is open source software developed by Citrusbyte.
The Redis logo was designed by Carlos Prioglio. See more credits.