Assigns new hash slot ranges to a node.
CLUSTER
ADDSLOTSRANGE
start-slot
end-slot [start-slot end-slot …]
The CLUSTER ADDSLOTSRANGE
is similar to the
CLUSTER ADDSLOTS
command in that they both assign hash
slots to nodes.
The difference between the two commands is that
CLUSTER ADDSLOTS
takes a list of slots to assign to the
node, while CLUSTER ADDSLOTSRANGE
takes a list of slot
ranges (specified by start and end slots) to assign to the node.
Simple string
reply: OK
if the command was successful. Otherwise an
error is returned.
O(N) where N is the total number of the slots between the start slot and end slot arguments.
@admin @dangerous @slow
To assign slots 1 2 3 4 5 to the node, the
CLUSTER ADDSLOTS
command is:
> CLUSTER ADDSLOTS 1 2 3 4 5
OK
The same operation can be completed with the following
CLUSTER ADDSLOTSRANGE
command:
> CLUSTER ADDSLOTSRANGE 1 5
OK
This command only works in cluster mode and is useful in the following Valkey Cluster operations:
CLUSTER ADDSLOTSRANGE
is used
to initially set up primary nodes splitting the available hash slots
among them.ASKING, CLUSTER, CLUSTER ADDSLOTS, CLUSTER BUMPEPOCH, CLUSTER COUNT-FAILURE-REPORTS, CLUSTER COUNTKEYSINSLOT, CLUSTER DELSLOTS, CLUSTER DELSLOTSRANGE, CLUSTER FAILOVER, CLUSTER FLUSHSLOTS, CLUSTER FORGET, CLUSTER GETKEYSINSLOT, CLUSTER HELP, CLUSTER INFO, CLUSTER KEYSLOT, CLUSTER LINKS, CLUSTER MEET, CLUSTER MYID, CLUSTER MYSHARDID, CLUSTER NODES, CLUSTER REPLICAS, CLUSTER REPLICATE, CLUSTER RESET, CLUSTER SAVECONFIG, CLUSTER SET-CONFIG-EPOCH, CLUSTER SETSLOT, CLUSTER SHARDS, CLUSTER SLOT-STATS, CLUSTER SLOTS, READONLY, READWRITE.