You are on page 1of 1

2) (integer) 7002

4) 1) "127.0.0.1"

2) (integer) 7005

The first two sub-elements of every element of the returned array are the start-end slots
of the range. The additional elements represent address-port pairs. The first address-
port pair is the master serving the slot, and the additional address-port pairs are all the
slaves serving the same slot that are not in an error condition (i.e. the FAIL flag is not
set).
For example the first element of the output says that slots from 5461 to 10922 (start and
end included) are served by 127.0.0.1:7001, and it is possible to scale read-only load
contacting the slave at 127.0.0.1:7004.
CLUSTER SLOTS is not guaranteed to return ranges that cover the full 16384 slots if
the cluster is misconfigured, so clients should initialize the slots configuration map filling
the target nodes with NULL objects, and report an error if the user tries to execute
commands about keys that belong to unassigned slots.
Before returning an error to the caller when a slot is found to be unassigned, the client
should try to fetch the slots configuration again to check if the cluster is now configured
properly.

Multiple keys operations


Using hash tags, clients are free to use multi-key operations. For example the following
operation is valid:

MSET {user:1000}.name Angela {user:1000}.surname White

Multi-key operations may become unavailable when a resharding of the hash slot the
keys belong to is in progress.
More specifically, even during a resharding the multi-key operations targeting keys that
all exist and all still hash to the same slot (either the source or destination node) are still
available.
Operations on keys that don't exist or are - during the resharding - split between the
source and destination nodes, will generate a -TRYAGAIN error. The client can try the
operation after some time, or report back the error.

You might also like