Skip to content

Instantly share code, notes, and snippets.

@junxy
Last active March 2, 2016 08:16
Show Gist options
  • Select an option

  • Save junxy/5af479ff047f3a964ef3 to your computer and use it in GitHub Desktop.

Select an option

Save junxy/5af479ff047f3a964ef3 to your computer and use it in GitHub Desktop.
RedisMaster:
image: bitnami/redis:latest
ports:
- "6380:6379"
environment:
- REDIS_PASSWORD=password
- REDIS_REPLICATION_MODE=master
restart: always
RedisSlave:
image: bitnami/redis:latest
ports:
- "6379"
environment:
- REDIS_PASSWORD=password
- REDIS_MASTER_HOST=master
- REDIS_MASTER_PORT=6379
- REDIS_MASTER_PASSWORD=password
- REDIS_REPLICATION_MODE=slave
links:
- RedisMaster:master
@junxy

junxy commented Mar 2, 2016

Copy link
Copy Markdown
Author

@junxy

junxy commented Mar 2, 2016

Copy link
Copy Markdown
Author
docker-compose scale RedisMaster=1 RedisSlave=3

docker exec -it redis2_RedisMaster_1 redis-cli -a password INFO Replication

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment