What is Redis Sentinel?
Redis Sentinel adds high availability to Redis: if the master goes down, the sentinels detect it, elect a new master from the replicas, and reconfigure the topology automatically. This template runs one master, two replicas, and three sentinels (quorum 2) - the standard HA layout.
One image plays all three roles, selected by an environment variable; the entrypoint builds each node’s command and the sentinel config from env. Sentinels are configured to resolve hostnames (service DNS) rather than raw IPs, which is what makes failover report a usable address on a multi-pod network. Verified locally: the master sees both replicas and all three sentinels agree.
Clients connect through Sentinel, not the master directly - a Sentinel-aware client (ioredis, redis-py, Lettuce, go-redis) asks a sentinel for the current master and is rerouted automatically on failover.
What you get
- Automatic failover: replica promoted when the master dies
- One master, two replicas, three sentinels (quorum 2)
- Hostname-based discovery - works on a multi-pod network
- Transparent to Sentinel-aware clients
- All internal-only, password-protected
- Redis 8 is AGPL-3.0
How it runs on Lyngbak
| Service | Role | Public |
|---|---|---|
redis-master | primary (:6379) | no (internal) |
redis-replica-1/2 | replicas (failover targets) | no |
redis-sentinel-1/2/3 | monitors + electors (:26379) | no |
Before you deploy
REDIS_PASSWORDshared by master, replicas, and sentinel auth
Sizing and billing
Master and replicas hold the full dataset in memory (size accordingly); sentinels are tiny (128 MiB). Six services, all internal.
A resource is a flat monthly price, with RAM and disk add-ons when the stack needs a little more than a tier, and room for your own apps on a larger one. On Usage Billing each service takes the smallest size that fits it and is billed by the second it runs, so a stopped stack stops costing CPU and RAM. Its 14.65 GiB of volumes cost $0.15 per GiB a month ($2.20/mo) for as long as they exist. One workspace can use both. See pricing
Compared with the managed service
| Service | Plan | Price | Includes |
|---|---|---|---|
| AWS ElastiCache | Multi-AZ (2 nodes) | $24/mo | primary + replica on-demand/mo for the smallest size |
| Redis Cloud | HA (multi-AZ) | $28/mo | highly-available tier, scales with memory |
Managed HA caches bill per node per AZ; this runs the whole failover topology in one stack, billed for the compute it reserves. Prices from each vendor's pricing page, June 2026.
Run it locally first
The same compose file runs with plain Docker Compose. Clone the template source, copy .env.example to .env, and run docker compose up -d.
Questions
When should I use Sentinel vs Cluster?
Sentinel gives you high availability (automatic failover) for a single dataset that fits on one node. Use redis-cluster instead when the data or throughput exceeds one node and you need sharding across multiple masters.
How do clients connect?
Through Sentinel, not the master directly. Point a Sentinel-aware client at redis-sentinel-1:26379, redis-sentinel-2:26379, redis-sentinel-3:26379 with master name "mymaster"; the client discovers the current master and follows failovers.
Does failover actually work on a shared platform?
Yes - the sentinels resolve service hostnames instead of pod IPs, so after a promotion they report a DNS name clients can reach. This template was smoke-tested locally: master with two connected replicas and three mutually-aware sentinels.