Skip to content

Instantly share code, notes, and snippets.

@RishikeshDarandale
Created June 6, 2022 17:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RishikeshDarandale/e1a8c1f516fcee33b255c26f64962041 to your computer and use it in GitHub Desktop.
Save RishikeshDarandale/e1a8c1f516fcee33b255c26f64962041 to your computer and use it in GitHub Desktop.
Staring a redis cluster using docker

Redis cluster using docker

A quick instruction to setup the redis cluster on local machine for quick testing. I am going to use bitnami docker images.

Instructions

  • Start the redis cluster with one master and one slave
docker-compose up -d
  • Tear down the redis cluster
docker-compose down
version: '3'
services:
redis-master:
image: 'bitnami/redis:5.0.14'
ports:
- '6379'
environment:
- REDIS_REPLICATION_MODE=master
- ALLOW_EMPTY_PASSWORD=yes
redis-replica:
image: 'bitnami/redis:5.0.14'
ports:
- '6379'
depends_on:
- redis-master
environment:
- REDIS_REPLICATION_MODE=slave
- REDIS_MASTER_HOST=redis-master
- REDIS_MASTER_PORT_NUMBER=6379
- ALLOW_EMPTY_PASSWORD=yes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment