Quick and dirty Redis cluster taking advantage of Redis Sentinel for automatic failover. Persistence is turned off by default.
-
Setup docker swarm
-
Modify scripts/docker-compose.yml to how you want to deploy the stack.
-
deploy the stack with
docker stack deploy -c scripts/docker-compose.yml <stack name>
- Connect to with redis-cli
docker exec -it $(docker ps --filter name=redis-sentinel -q) redis-cli
From now on just scale redis
to expand the number of slaves or scale redis-sentinel
to increase the number of sentinels.