Incident Response

Redis "CLUSTERDOWN The cluster is down": What It Means and How to Recover

One failed shard can stop every write in a Redis Cluster, by design. Here is how to tell which of the three CLUSTERDOWN errors you have, how to bring the cluster back, and how to avoid the next one.

· 11 min read · AG Data Team

CLUSTERDOWN The cluster is down is what a Redis Cluster node replies when it has decided the cluster is not healthy enough to serve queries. It is not a bug and it is not one node misbehaving: it is the cluster protecting your data. To fix it you need to know which of two conditions triggered it, and that takes one command.

Redis splits the key space into 16384 hash slots, and every slot must belong to a reachable primary. The Redis Cluster documentation is clear that the cluster continues through small failures but becomes unavailable during larger ones, for example when the majority of primaries are unreachable. Valkey, which forked from Redis, uses the same three error messages and the same rules.

Three CLUSTERDOWN errors, three meanings

Why the cluster goes down

In the Redis source, a node flips its cluster state to fail for one of two reasons:

  1. Slot coverage is broken. With cluster-require-full-coverage yes (the default), if any of the 16384 slots has no owner or is owned by a node flagged FAIL, the whole cluster stops accepting queries, not just the keys in those slots. The typical story: a primary dies and has no working replica to take over, so its slots stay uncovered.
  2. The node is in a minority. If a node cannot reach a majority of the primaries that serve slots, it marks the cluster as failed. The documentation describes this as a node that cannot sense the majority of other primaries for longer than the node timeout entering an error state. A network partition, a security group change or an overloaded host can do this.

Diagnose with CLUSTER INFO

$ redis-cli -c -h 10.0.3.11 -p 6379 SET user:42 x
(error) CLUSTERDOWN The cluster is down

$ redis-cli -h 10.0.3.11 -p 6379 CLUSTER INFO | head -7
cluster_state:fail
cluster_slots_assigned:16384
cluster_slots_ok:10923
cluster_slots_pfail:0
cluster_slots_fail:5461
cluster_known_nodes:6
cluster_size:3

The CLUSTER INFO fields tell you which case you are in. cluster_slots_fail above zero means slots belong to a node in FAIL state: a coverage problem. cluster_slots_assigned below 16384 means some slots have no owner at all. If every slot looks fine but cluster_state is still fail, ask the same question from a node on the other side of the network: you are probably talking to a node in a minority partition. cluster_slots_pfail counts slots whose owner is only suspected to be down; those still work until the suspicion is confirmed.

# which node owns the failed slots, and does it have a replica?
$ redis-cli -h 10.0.3.11 -p 6379 CLUSTER NODES | grep -E "master|fail"

# full consistency check from any node
$ redis-cli --cluster check 10.0.3.11:6379

Getting back up

  1. Bring the failed primary back if you can. Often it is a restarted process or a full disk. Once it rejoins and its slots are covered, the cluster returns to ok on its own. A restarted primary waits a short moment before accepting writes so it can receive a configuration update first, so do not panic over the first second or two.
  2. Promote a replica manually if automatic failover did not happen. Run CLUSTER FAILOVER FORCE on the replica you want to promote when its primary is unreachable. FORCE still needs a majority of primaries to authorize the new configuration. A replica that was disconnected too long may refuse to fail over automatically because of cluster-replica-validity-factor, which is exactly when a manual failover helps.
  3. Assign or move missing slots. For "Hash slot not served", redis-cli --cluster check lists uncovered slots and redis-cli --cluster fix can assign them. Check first: if those slots had data on a node that is gone, fixing coverage gives you empty slots, not your data back.
Use TAKEOVER only as a last resort. CLUSTER FAILOVER TAKEOVER promotes a replica without any agreement from the cluster. The documentation says it violates the last-failover-wins principle and should be used with care, for example to switch data centres while all primaries are down. Used inside a minority partition, it can leave two nodes claiming the same slots.

Settings that change the behaviour

If clients keep writing to an old node after a failover in a non-cluster setup, that is a different error; see our Redis READONLY guide.

What changes with large datasets

Key takeaways

Redis Valkey Redis Cluster High Availability
Work with us

Redis Cluster down right now?

We recover Redis and Valkey clusters, fix slot coverage and failover, and redesign shard and replica layouts so one failed node does not stop production.

Get in touch More from the blog