Skip to content

Instantly share code, notes, and snippets.

@brunoguerra
Created June 1, 2018 13:24
Show Gist options
  • Save brunoguerra/4c89d8e42b6146c957c39c1d27b56311 to your computer and use it in GitHub Desktop.
Save brunoguerra/4c89d8e42b6146c957c39c1d27b56311 to your computer and use it in GitHub Desktop.
Mongo replica-set with docker
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
@brunoguerra
Copy link
Author

I've got this error
screen shot 2018-06-01 at 10 40 58

@brunoguerra
Copy link
Author

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'

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