/redis-cluster-docker-swarm

Redis cluster cache configuration for docker swarm

Primary LanguageShellMIT LicenseMIT

Redis Cluster Cache for Docker Swarm

Quick and dirty Redis cluster taking advantage of Redis Sentinel for automatic failover. Persistence is turned off by default.

Usage

  1. Setup docker swarm

  2. Modify scripts/docker-compose.yml to how you want to deploy the stack.

  3. deploy the stack with

docker stack deploy -c scripts/docker-compose.yml <stack name>
  1. Connect to with redis-cli
docker exec -it $(docker ps --filter name=redis-sentinel -q) redis-cli

Scaling

From now on just scale redis to expand the number of slaves or scale redis-sentinel to increase the number of sentinels.