Redis Sentinel HA Cluster — Automated Failover with HAProxy

Lead Operations Engineer – DevOps · Network Redux

View on GitHub

Built a production-tested, highly available Redis caching layer using Sentinel for automatic failover and HAProxy for transparent master routing. Open-sourced the setup and documentation.

Context

Production applications needed a Redis caching layer that could survive node failures without manual intervention or application-side changes. The solution had to be simple, reliable, and deployable on standard Linux infrastructure.

What I Did

  • Designed a 3-node Redis cluster — 1 master, 2 replicas — with automatic promotion on failure
  • Configured 3 Sentinel instances with quorum-based failover (quorum of 2)
  • Set up HAProxy with TCP health checks to route connections to the current master transparently
  • Documented the full setup and open-sourced it on GitHub

Results

MetricDetail
FailoverZero-downtime — automatic master promotion
App changesNone — clients connect through HAProxy transparently
Open sourceGitHub repo

Stack

Redis · Redis Sentinel · HAProxy · CentOS · Linux