cluster-reset.3valkey - Man Page
Resets a node.
Synopsis
CLUSTER RESET
[HARD
| SOFT
]
Description
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 masters if they hold one or more keys, in that case to completely reset a master node keys must be removed first, e.g. by using FLUSHALL
first, and then CLUSTER RESET
.
Effects on the node:
- All the other nodes in the cluster are forgotten.
- All the assigned / open slots are reset, so the slots-to-nodes mapping is totally cleared.
- If the node is a replica it is turned into an (empty) master. Its dataset is flushed, so at the end the node will be an empty master.
- Hard reset only: a new Node ID is generated.
- Hard reset only:
currentEpoch
andconfigEpoch
vars are set to 0. - The new configuration is persisted on disk in the node cluster configuration file.
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.
Reply
valkey-protocol(7) Simple string reply: OK
if the command was successful. Otherwise an error is returned.
Complexity
O(N) where N is the number of known nodes. The command may execute a FLUSHALL as a side effect.
Acl Categories
@admin @dangerous @slow
History
- Available since: 3.0.0
See Also
asking(3valkey), cluster(3valkey), cluster-addslots(3valkey), cluster-addslotsrange(3valkey), cluster-bumpepoch(3valkey), cluster-count-failure-reports(3valkey), cluster-countkeysinslot(3valkey), cluster-delslots(3valkey), cluster-delslotsrange(3valkey), cluster-failover(3valkey), cluster-flushslots(3valkey), cluster-forget(3valkey), cluster-getkeysinslot(3valkey), cluster-help(3valkey), cluster-info(3valkey), cluster-keyslot(3valkey), cluster-links(3valkey), cluster-meet(3valkey), cluster-myid(3valkey), cluster-myshardid(3valkey), cluster-nodes(3valkey), cluster-replicas(3valkey), cluster-replicate(3valkey), cluster-saveconfig(3valkey), cluster-set-config-epoch(3valkey), cluster-setslot(3valkey), cluster-shards(3valkey), cluster-slots(3valkey), readonly(3valkey), readwrite(3valkey)