Created
January 13, 2018 17:56
-
-
Save rubanraj54/f1262c8b6fc4f755188231fe30380dcc to your computer and use it in GitHub Desktop.
Simple MongoDB cluster using docker compose (3 node cluster)
This file contains 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
ports for mongo is 27017 and not 27071
Please correct