What's Actually Happening

Redis cluster is down or partially unavailable. Some slots have no serving node.

The Error You'll See

```bash $ redis-cli cluster info

cluster_state:fail cluster_slots_assigned:16384 cluster_slots_ok:12288 cluster_slots_pfail:4096 ```

Why This Happens

  1. 1.Multiple node failure - Not enough masters up
  2. 2.Slot migration incomplete - Slots in MIGRATING state
  3. 3.Network partition - Nodes cannot communicate
  4. 4.Configuration error - cluster-config-file corrupted

Step 1: Check Cluster Status

```bash # Check cluster info: redis-cli cluster info

# Check nodes: redis-cli cluster nodes

# Check slots: redis-cli cluster slots ```

Step 2: Identify Failed Nodes

```bash # Find failed nodes: redis-cli cluster nodes | grep fail

# Check node health: redis-cli -h node1 ping redis-cli -h node2 ping ```

Step 3: Restart Failed Nodes

```bash # Start Redis on failed nodes: systemctl start redis

# Check if rejoined: redis-cli cluster nodes ```

Step 4: Fix Cluster State

```bash # Fix slots assignment: redis-cli --cluster fix 127.0.0.1:7000

# Or rebalance: redis-cli --cluster rebalance 127.0.0.1:7000 ```

Redis Cluster Checklist

CheckCommandExpected
cluster_statecluster infook
All nodes upcluster nodesconnected
Slots coveredcluster info16384

Verify the Fix

bash
redis-cli cluster info
# Output: cluster_state:ok
  • [Fix Redis Memory Limit Exceeded](/articles/fix-redis-memory-limit-exceeded)
  • [Fix Redis Connection Refused](/articles/fix-redis-connection-refused)