Skip to content

Ask the HotKV docs

Answers come only from these docs and can be wrong; check the linked pages before you rely on them.

CLUSTER ADDSLOTS

Last updated
CLUSTER ADDSLOTS slot [slot ...]
Group
Cluster
Complexity
O(N) where N is the number of slots
Arity
-3 (at least 3 words, counting the command name)
HotKV Cloud
Not available
On-Premise
no license needed

CLUSTER ADDSLOTS makes the receiving node the owner of the given hash slots (0 to 16383). You use it when you build a cluster by hand: each primary claims its slots, and the other nodes learn about it over the cluster bus. redis-cli --cluster create does this for you.

Every slot is checked before any is assigned, so the command adds all the slots or none of them. A slot can be added only if no node owns it yet in this node’s view, the node itself included. Adding a slot also ends any import of that slot this node had open.

The node’s configuration epoch does not change, so you can still give each new primary its own epoch with CLUSTER SET-CONFIG-EPOCH.

Simple string OK in RESP2 and RESP3, or one of these errors:

Case Error
A slot is not an integer from 0 to 16383 ERR Invalid or out of range slot
A slot already has an owner ERR Slot <slot> is already busy
The same slot is given twice ERR Slot <slot> specified multiple times
Cluster mode is off ERR This instance has cluster support disabled
127.0.0.1:6379> CLUSTER ADDSLOTS 0 1 2
OK
127.0.0.1:6379> CLUSTER ADDSLOTS 2 3
(error) ERR Slot 2 is already busy
127.0.0.1:6379> CLUSTER ADDSLOTS 4 4
(error) ERR Slot 4 specified multiple times
127.0.0.1:6379> CLUSTER ADDSLOTS 16384
(error) ERR Invalid or out of range slot

Same checks, replies and error strings as Redis 7 and Valkey 8.

CLUSTER ADDSLOTSRANGE, CLUSTER DELSLOTS, CLUSTER SETSLOT, CLUSTER SLOTS

In a cluster: Scaling a cluster