Introduction

Redis cluster node cannot join when cluster meet fails or config epoch conflict. This guide provides step-by-step diagnosis and resolution.

Symptoms

Typical error output:

bash
Error: Node 10.0.0.2:6379 is not empty
Cannot join cluster: config epoch conflict
Node already knows another cluster

Common Causes

  1. 1.Node already has data from different cluster
  2. 2.Config epoch conflict with existing nodes
  3. 3.CLUSTER MEET not executed correctly
  4. 4.Network partition during join

Step-by-Step Fix

Step 1: Check Current State

bash
redis-cli cluster meet <ip> <port>
redis-cli cluster nodes
redis-cli cluster info

Step 2: Identify Root Cause

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

Step 3: Apply Primary Fix

bash
# Reset node and join cluster
redis-cli -h <new-node> FLUSHALL
redis-cli -h <new-node> CLUSTER RESET HARD
redis-cli -h <existing-node> CLUSTER MEET <new-node-ip> 6379

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 cluster nodes
redis-cli cluster info
# Node should appear in cluster

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