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 RESET

Last updated
CLUSTER RESET [HARD | SOFT]
Group
Cluster
Complexity
O(N) where N is the number of known nodes
Arity
-2 (at least 2 words, counting the command name)
HotKV Cloud
All plans
On-Premise
no license needed

CLUSTER RESET takes the receiving node out of its cluster. The node forgets every other node, drops all its slots and slot migrations, and closes its cluster bus links. Use it to reuse a node in a new cluster, or to rebuild a cluster in tests. To bring the node back, meet it again with CLUSTER MEET.

A primary must hold no keys (HotKV’s AI feature data counts as keys here). A replica becomes an empty primary: its copy of the old primary’s data is deleted.

Option Effect
SOFT (default) Keeps the node ID and its epochs. A replica gets a shard ID of its own.
HARD Also gives the node a new ID and sets its epochs back to 0.

The node keeps its address, its hostname and its human-readable name through either reset.

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

Case Error
A primary that holds keys ERR CLUSTER RESET can't be called with master nodes containing keys
An option other than HARD or SOFT ERR syntax error

On a replica the reset drops its copy of the data and leaves an empty primary with no slots:

127.0.0.1:7003> CLUSTER RESET
OK
$ redis-cli -p 7003 INFO replication | grep -E "role|connected"
role:master
connected_slaves:0
$ redis-cli -p 7003 CLUSTER NODES | cut -d" " -f2,3,9
127.0.0.1:7003@17003 myself,master

On a primary that holds keys:

127.0.0.1:6379> CLUSTER RESET
(error) ERR CLUSTER RESET can't be called with master nodes containing keys
127.0.0.1:6379> FLUSHALL
OK
127.0.0.1:6379> CLUSTER RESET HARD
OK
127.0.0.1:6379> CLUSTER INFO
cluster_enabled:1
cluster_state:fail
cluster_slots_assigned:0
...

Same options, effects and error strings as Redis 7 and Valkey 8.

CLUSTER MEET, CLUSTER FORGET, CLUSTER FLUSHSLOTS, CLUSTER REPLICATE, Scaling a cluster