-
-
Save danqulogy/eb623e82b58cc63559fa73ebf134458e to your computer and use it in GitHub Desktop.
Simple MongoDB cluster using docker compose (3 node 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' | |
| services: | |
| node1: | |
| image: mongo | |
| ports: | |
| - 30001:27071 | |
| volumes: | |
| - $HOME/mongoclusterdata/node1:/data/db | |
| networks: | |
| - mongocluster | |
| command: mongod --replSet comments | |
| node2: | |
| image: mongo | |
| ports: | |
| - 30002:27071 | |
| volumes: | |
| - $HOME/mongoclusterdata/node2:/data/db | |
| networks: | |
| - mongocluster | |
| command: mongod --replSet comments | |
| depends_on : | |
| - node1 | |
| node3: | |
| image: mongo | |
| ports: | |
| - 30003:27071 | |
| volumes: | |
| - $HOME/mongoclusterdata/node3:/data/db | |
| networks: | |
| - mongocluster | |
| command: mongod --replSet comments | |
| depends_on : | |
| - node2 | |
| networks: | |
| mongocluster: | |
| driver: bridge |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment