Comments (4)
You will probably need user define bridge/ host only network to achieve that, depending on configuration of your network.
I would start with this piece of documentation https://blog.docker.com/2016/12/understanding-docker-networking-drivers-use-cases/ and
sudo docker network ls
to determine ids of configuration of bridge and host network
sudo docker network inspect <your id>
to confirm network configuration. Then you can reconfigure / create new it accordingly and then update my docker-compose.
https://docs.docker.com/compose/networking/#configure-the-default-network
BTW What operating system and docker version ?
from mongo-cluster-docker.
Thanks for quick response
following is my docker-compose file
version: '2'
services:
mongo-cnf-2:
container_name: "mongo-cnf-2"
image: mongo:3.4.14
ports:
- "30002:27017"
volumes:
- ./mongodb.key:/data/mongodb.key
- /mnt/mongo-data-2:/data/db/
- /etc/localtime:/etc/localtime:ro
command: mongod --replSet testreplica --rest --httpinterface --port 27017 --oplogSize 16 --smallfiles
restart: always
networks:
- mongodb-network
mongo-cnf-3:
container_name: "mongo-cnf-3"
image: mongo:3.4.14
ports:
- "30003:27017"
volumes:
- ./mongodb.key:/data/mongodb.key
- /mnt/mongo-data-3:/data/db/
- /etc/localtime:/etc/localtime:ro
command: mongod --replSet testreplica --rest --httpinterface --port 27017 --oplogSize 16 --smallfiles
restart: always
networks:
- mongodb-network
mongo-cnf-1:
container_name: "mongo-cnf-1"
image: mongo:3.4.14
ports:
- "30001:27017"
volumes:
- ./mongodb.key:/data/mongodb.key
- /mnt/mongo-data-1:/data/db/
- /etc/localtime:/etc/localtime:ro
command: mongod --replSet testreplica --rest --httpinterface --port 27017 --oplogSize 16 --smallfiles
links:
- mongo-cnf-2:mongo-cnf-2
- mongo-cnf-3:mongo-cnf-3
restart: always
networks:
- mongodb-network
mongo-cnf-setup:
container_name: "mongo-cnf-setup"
image: mongo:3.4.14
depends_on:
- "mongo-cnf-1"
- "mongo-cnf-2"
- "mongo-cnf-3"
links:
- mongo-cnf-1:mongo-cnf-1
- mongo-cnf-2:mongo-cnf-2
- mongo-cnf-3:mongo-cnf-3
volumes:
- ./scripts:/scripts
- ./mongodb.key:/data/mongodb.key
- /mnt/mongo-data-setup:/data/db/
- /etc/localtime:/etc/localtime:ro
env_file:
- ./.env
networks:
- mongodb-network
environment:
- MONGO1=mongo-cnf-1
- MONGO2=mongo-cnf-2
- MONGO3=mongo-cnf-3
- RS=testreplica
- PORT=27017
entrypoint: [ "/scripts/setup-cnf.sh" ]
networks:
mongodb-network:
driver: bridge
Yes i use User Define bridge network only
[
{
"Name": "project_testprod_mongodb-network",
"Id": "417fe3379bed74b29707b8671b350021ce11305217b602d2e09d60c17e40e2b4",
"Created": "2018-04-20T16:36:08.325559369+05:30",
"Scope": "local",
"Driver": "bridge",
"EnableIPv6": false,
"IPAM": {
"Driver": "default",
"Options": null,
"Config": [
{
"Subnet": "172.19.0.0/16",
"Gateway": "172.19.0.1"
}
]
},
"Internal": false,
"Attachable": false,
"Ingress": false,
"ConfigFrom": {
"Network": ""
},
"ConfigOnly": false,
"Containers": {
"433ba4e1bf5d1ec03769a6281263a3f776e9760a00d502e679cbb25497552446": {
"Name": "mongo-cnf-3",
"EndpointID": "87581398921f1aeecae3ca828a1ada34d95b868475aad19d3cad41b2d21a933b",
"MacAddress": "02:42:ac:13:00:02",
"IPv4Address": "172.19.0.2/16",
"IPv6Address": ""
},
"5f565964391abd1ecbee317135ac770378fb7ade0d0dc27cb89d6ac214ecc438": {
"Name": "mongo-cnf-1",
"EndpointID": "83f92afa5e6af23dd4243da355354c059cf1891fa4e589fe05b9215c6598b57c",
"MacAddress": "02:42:ac:13:00:04",
"IPv4Address": "172.19.0.4/16",
"IPv6Address": ""
},
"f46ddc963727e53d556bf1ec1c0529a7acb07b60cec10405549066d818e56591": {
"Name": "mongo-cnf-2",
"EndpointID": "b25394139a9238fecd4148c5932571912589d7d4a74c6845484feea86d5364f6",
"MacAddress": "02:42:ac:13:00:03",
"IPv4Address": "172.19.0.3/16",
"IPv6Address": ""
}
},
"Options": {},
"Labels": {}
}
]
BTW What operating system and docker version ?
OS : Centos 7 x64bit
Docker Version :
Client:
Version: 18.04.0-ce
API version: 1.37
Go version: go1.9.4
Git commit: 3d479c0
Built: Tue Apr 10 18:21:36 2018
OS/Arch: linux/amd64
Experimental: false
Orchestrator: swarmServer:
Engine:
Version: 18.04.0-ce
API version: 1.37 (minimum version 1.12)
Go version: go1.9.4
Git commit: 3d479c0
Built: Tue Apr 10 18:25:25 2018
OS/Arch: linux/amd64
Experimental: false
from mongo-cluster-docker.
@sinalkar Recently we will get fixed some issues occurring on latest mongodb
version (4.x)
One of which is related on mongos
binding configuration options like --bindIpAll
and --ipv6
https://docs.mongodb.com/manual/reference/configuration-options/
from mongo-cluster-docker.
Closing the issue. Please drop me a not if you want to reopen.
from mongo-cluster-docker.
Related Issues (16)
- Add sample sharding with index.
- Not working ping on docker container
- Update docs with latest and upcoming mongo
- No shards? HOT 4
- Invalid `--rest` parameters on `mongo-cnf`
- Support for replication protocol version 0 was removed in MongoDB 4.0.
- MongoDB 4.0, you cannot specify --nojournal in replica set on wiredTiger engine
- Where The Data Path Setting? HOT 2
- replSetGetStatus is not supported through mongos HOT 1
- dont work in sworm HOT 1
- No primary detected for set cnf-serv HOT 8
- Missing support for proper healthchecks HOT 4
- Missing chmod +x
- scripts need the execute permission
- I have a bit of a problem. HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mongo-cluster-docker.