修改本页

Redis 命令 客户端 文档 社区 下载 问题 支持 许可

CLUSTER SLOTS

相关命令

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

  1. 127.0.0.1:7001> cluster slots
  2. 1) 1) (integer) 0
  3. 2) (integer) 4095
  4. 3) 1) "127.0.0.1"
  5. 2) (integer) 7000
  6. 4) 1) "127.0.0.1"
  7. 2) (integer) 7004
  8. 2) 1) (integer) 12288
  9. 2) (integer) 16383
  10. 3) 1) "127.0.0.1"
  11. 2) (integer) 7003
  12. 4) 1) "127.0.0.1"
  13. 2) (integer) 7007
  14. 3) 1) (integer) 4096
  15. 2) (integer) 8191
  16. 3) 1) "127.0.0.1"
  17. 2) (integer) 7001
  18. 4) 1) "127.0.0.1"
  19. 2) (integer) 7005
  20. 4) 1) (integer) 8192
  21. 2) (integer) 12287
  22. 3) 1) "127.0.0.1"
  23. 2) (integer) 7002
  24. 4) 1) "127.0.0.1"
  25. 2) (integer) 7006

返回值

Array reply: nested list of slot ranges with IP/Port mappings.

Comments powered by Disqus

This website is open source software developed by Citrusbyte.

The Redis logo was designed by Carlos Prioglio. See more credits.

Sponsored by Redis Support