Resets a node.
CLUSTER
RESET
[HARD
| SOFT
]
Reset a Valkey Cluster node, in a more or less drastic way depending
on the reset type, that can be hard or
soft. Note that this command does not work for
primaries if they hold one or more keys, in that case to
completely reset a primary node keys must be removed first, e.g. by
using FLUSHALL
first, and then
CLUSTER RESET
.
Effects on the node:
currentEpoch
and
configEpoch
vars are set to 0.This command is mainly useful to re-provision a Valkey Cluster node in order to be used in the context of a new, different cluster. The command is also extensively used by the Valkey Cluster testing framework in order to reset the state of the cluster every time a new test unit is executed.
If no reset type is specified, the default is soft.
Simple string
reply: OK
if the command was successful. Otherwise an
error is returned.
O(N) where N is the number of known nodes. The command may execute a FLUSHALL as a side effect.
@admin @dangerous @slow
ASKING, CLUSTER, CLUSTER ADDSLOTS, CLUSTER ADDSLOTSRANGE, 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 SAVECONFIG, CLUSTER SET-CONFIG-EPOCH, CLUSTER SETSLOT, CLUSTER SHARDS, CLUSTER SLOT-STATS, CLUSTER SLOTS, READONLY, READWRITE.