Introduction

Redis Sentinel cannot reach quorum when too few sentinels available or network partition. This guide provides step-by-step diagnosis and resolution.

Symptoms

Typical error output:

bash
Error: QUORUM not reached
Sentinel cannot failover master: not enough sentinels
Needed: 2, Available: 1

Common Causes

  1. 1.Not enough Sentinel instances running
  2. 2.Network partition between Sentinels
  3. 3.Sentinel configuration mymisconfigured
  4. 4.Sentinel down-after-milliseconds too aggressive

Step-by-Step Fix

Step 1: Check Current State

bash
redis-cli -p 26379 SENTINEL master mymaster
redis-cli -p 26379 SENTINEL sentinels mymaster
redis-cli -p 26379 SENTINEL CKQUORUM mymaster

Step 2: Identify Root Cause

bash
redis-cli INFO
redis-cli CONFIG GET "*"
redis-cli SLOWLOG GET 10

Step 3: Apply Primary Fix

```bash # Update quorum config # In sentinel.conf: sentinel monitor mymaster <master-ip> 6379 2 sentinel down-after-milliseconds mymaster 30000 sentinel failover-timeout mymaster 60000

# Restart sentinel redis-sentinel /path/to/sentinel.conf ```

Step 4: Apply Alternative Fix

```bash # Alternative fix: Check configuration redis-cli CONFIG GET "*memory*" redis-cli CONFIG GET "*timeout*"

# Update settings redis-cli CONFIG SET parameter value

# Verify the fix redis-cli INFO ```

Step 5: Verify the Fix

bash
redis-cli -p 26379 SENTINEL CKQUORUM mymaster
redis-cli -p 26379 SENTINEL master mymaster
# Quorum should be OK

Common Pitfalls

  • Not using connection pooling for high-throughput applications
  • Setting maxmemory without eviction policy
  • Using KEYS command in production
  • Not monitoring replication lag

Best Practices

  • Monitor Redis memory and fragmentation regularly
  • Use SCAN instead of KEYS for key enumeration
  • Configure appropriate eviction policy for workload
  • Implement proper backup strategy (RDB or AOF)
  • Redis Connection Refused
  • Redis High Latency
  • Redis Cluster Down
  • Redis Persistence Failed