High Availability

Redis Cluster: Setup, Resharding, and Operational Guide

Deploy and operate a Redis Cluster with automatic sharding and HA. Covers 6-node setup, health checks, adding master nodes, resharding, and manual failover.

JusDB Team
March 19, 2025
Updated June 20, 2026
5 min read

Redis Cluster provides automatic data sharding across multiple nodes with no single point of failure. This guide covers setup, resharding, and common operational tasks.

Redis Cluster Fundamentals

  • Data is split into 16384 hash slots across master nodes
  • Each master has one or more replicas for HA
  • Minimum recommended: 3 masters + 3 replicas (6 nodes)

redis.conf for Cluster Mode

ini
port 7001
cluster-enabled yes
cluster-config-file nodes-7001.conf
cluster-node-timeout 5000
appendonly yes
appendfilename appendonly-7001.aof
save 900 1
save 300 10

Create a 6-Node Cluster

bash
# Start 6 Redis instances on ports 7001-7006
for port in 7001 7002 7003 7004 7005 7006; do
  redis-server /etc/redis/redis-$port.conf --daemonize yes
done

# Create cluster (--cluster-replicas 1 = 1 replica per master)
redis-cli --cluster create \
  127.0.0.1:7001 127.0.0.1:7002 127.0.0.1:7003 \
  127.0.0.1:7004 127.0.0.1:7005 127.0.0.1:7006 \
  --cluster-replicas 1 --cluster-yes

Check Cluster Status

bash
redis-cli -p 7001 cluster info
redis-cli -p 7001 cluster nodes

# Detailed health check
redis-cli --cluster check 127.0.0.1:7001

Add a New Master Node

bash
# Start new Redis instance on port 7007
redis-cli --cluster add-node 127.0.0.1:7007 127.0.0.1:7001

# Reshard to move slots to new master
redis-cli --cluster reshard 127.0.0.1:7001

Manual Failover

bash
# Trigger failover from a replica
redis-cli -p 7004 cluster failover

# Force failover (even if master is reachable)
redis-cli -p 7004 cluster failover force
Tip: Use cluster failover (without FORCE) for planned maintenance — it waits until the replica is fully caught up before promoting, preventing data loss.

Key Takeaways

  • Minimum 3 masters ensures a quorum majority for cluster decisions
  • Always provision replicas (--cluster-replicas 1) to survive node failures
  • Use redis-cli --cluster check for ongoing health verification
  • Prefer cluster failover over FORCE for planned switchovers

JusDB Can Help

Redis Cluster operations — resharding, node replacement, capacity planning — require expertise. JusDB supports Redis deployments at any scale.

Share this article

JusDB Team

Official JusDB content team

Keep reading

MySQL Group Replication (2026): Multi-Primary HA, Conflict Resolution & Production Setup

Production-ready MySQL Group Replication deployment guide. Learn cluster sizing, monitoring setup, performance tuning, and disaster recovery planning.

MySQL5 minMay 13, 2026
Read

MariaDB Galera Cluster Production Guide: Mariabackup, MaxScale & Schema Strategy

Production MariaDB Galera Cluster: mariabackup-based SST, MaxScale Galera-aware routing, schema-change strategy with TOI vs RSU, and a troubleshooting playbook for the failures that actually take down production.

MySQL17 minMay 3, 2026
Read

Patroni with Consul DCS: PostgreSQL HA Without etcd

Configure Patroni to use Consul instead of etcd as its DCS for PostgreSQL HA. Covers Consul setup, patroni.yml, service discovery, HAProxy routing, and failover testing.

PostgreSQL10 minMar 5, 2026
Read