Created
June 1, 2018 13:24
-
-
Save brunoguerra/4c89d8e42b6146c957c39c1d27b56311 to your computer and use it in GitHub Desktop.
Mongo replica-set with docker
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: '2' | |
services: | |
replica1: | |
image: mongo:3.0 | |
container_name: mongo1 | |
ports: | |
- "27017:27017" | |
volumes: | |
- ./mongodata/replica1:/data/db | |
command: mongod --smallfiles --replSet "mrmtx" | |
networks: | |
- mongo_cluster | |
replica2: | |
image: mongo:3.0 | |
container_name: mongo2 | |
ports: | |
- "27017:27017" | |
volumes: | |
- ./mongodata/replica2:/data/db | |
command: mongod --smallfiles --replSet "mrmtx" | |
networks: | |
- mongo_cluster | |
replica3: | |
image: mongo:3.0 | |
container_name: mongo3 | |
ports: | |
- "27017:27017" | |
volumes: | |
- ./mongodata/replica3:/data/db | |
command: mongod --smallfiles --replSet "mrmtx" | |
networks: | |
- mongo_cluster | |
networks: | |
mongo_cluster: | |
driver: overlay |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Cannot start service replica2: b'Could not attach to network mongo-rplset_mongo_cluster: rpc error: code = PermissionDenied desc = network mongo-rplset_mongo_cluster not manually attachable'