Last active
March 25, 2019 10:18
-
-
Save nickadam/aebc1a3290d42df529fa2c4afc6aab4f to your computer and use it in GitHub Desktop.
Active-Passive Redis Cluster
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| version: '3.5' | |
| services: | |
| master: | |
| image: redis:5 | |
| command: ["redis-server", "--appendonly", "yes"] | |
| volumes: | |
| - db:/data | |
| ports: | |
| - target: 6379 | |
| published: 6379 | |
| mode: host | |
| deploy: | |
| mode: global | |
| placement: | |
| constraints: [node.labels.redis == master] | |
| slave: | |
| image: redis:5 | |
| command: ["redis-server", "--slaveof", "master", "6379", "--appendonly", "yes"] | |
| volumes: | |
| - db:/data | |
| ports: | |
| - target: 6379 | |
| published: 6379 | |
| mode: host | |
| depends_on: | |
| - master | |
| deploy: | |
| mode: global | |
| placement: | |
| constraints: [node.labels.redis == slave] | |
| volumes: | |
| db: {} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment