What is Redis Cluster?
Redis Cluster shards your keyspace across multiple master nodes, so capacity and throughput scale horizontally instead of being capped by a single node. This template runs six nodes - three master shards, each with one replica - and a one-shot init that forms the cluster (verified locally: cluster_state ok, all 16384 slots covered).
Each node announces its service hostname (cluster-announce-hostname + hostname endpoints) so clients and cross-slot redirects use DNS rather than raw pod IPs. The init waits for every node, then forms the cluster once and is idempotent on re-run.
Use this when a single node is not enough. If you only need failover of one dataset (no sharding), redis-sentinel is simpler; for a single node, use redis.
What you get
- Automatic sharding across 3 master shards
- 6 nodes (3 masters + 3 replicas) + one-shot forming init
- Hostname-announced nodes for DNS-based routing
- Scales capacity and throughput beyond one node
- All internal-only, password-protected
- Redis 8 is AGPL-3.0
How it runs on Lyngbak
| Service | Role | Public |
|---|---|---|
redis-node-1..6 | 3 masters + 3 replicas (:6379) | no (internal) |
redis-init | forms the cluster once, then exits | no |
Before you deploy
REDIS_PASSWORDshared by every node and the init
Sizing and billing
Six in-memory nodes - size RAM to total dataset divided across 3 shards (plus replicas). Experimental: Cluster expects stable node identity, and a pod IP change can require a re-meet.
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 29.3 GiB of volumes cost $0.15 per GiB a month ($4.40/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 | cluster mode (6 nodes) | $72/mo | 3 shards + 3 replicas on-demand/mo at the smallest size |
| Redis Cloud | Flexible (sharded) | Usage-based | priced by memory + throughput across shards |
Managed cluster mode bills every shard and replica; self-hosted is 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
Why is it experimental?
Redis Cluster assumes stable node identities and is finicky on any per-pod platform. This template announces service hostnames so routing uses DNS, and it forms cleanly (smoke-tested), but a pod IP change can still need the cluster to re-meet. Treat it as a power-user topology.
Do my clients need changes?
Clients must be cluster-aware (ioredis, redis-py, Lettuce, go-redis all have a cluster mode). They connect to any node at redis-node-1:6379 and follow MOVED/ASK redirects to the owning shard automatically.
Cluster or Sentinel?
Cluster is for scale (sharding the keyspace across masters). Sentinel is for HA of a single dataset (failover, no sharding). If your data fits on one node, Sentinel is the simpler choice.