chefsplate / mongo-shard-docker-compose

100 stars 66 forks source link

Error: network error while attempting to run command 'isMaster' on host '127.0.0.1:27017' #1

Open VogtlaenderManuel opened 6 years ago

VogtlaenderManuel commented 6 years ago

Got fthe following error when i want to connect from outside the container.

manuels-mbp:mongo-shard-docker-compose-master vogtlaenderm$ mongo MongoDB shell version v3.6.5 connecting to: mongodb://127.0.0.1:27017 2018-06-04T17:15:55.898+0200 E QUERY [thread1] Error: network error while attempting to run command 'isMaster' on host '127.0.0.1:27017' : connect@src/mongo/shell/mongo.js:251:13 @(connect):1:6 exception: connect failed

dror-g commented 6 years ago

It seems to take longer for the router to become ready with Mongo version 4.0.2. You can manually retry the last command from init.sh: docker-compose exec router sh -c "mongo < /scripts/init-router.js"

or you can attach to the router with: docker-compose exec router mongo then execute the addShard for each member as in scripts/init-router.js: sh.addShard("shard01/shard01a:27018")

slinstaedt commented 5 years ago

This issue should be fixed with the latest change.

hassanshamshir commented 5 years ago

How can we implement Mongodb cluster on different server by using Docker.

thearabbit commented 5 years ago

the same, I wold like to try on digitalocean 2 or 3 droplets??? Could you share

micaelomota commented 4 years ago

same here with rancher. But I've tried with 4.0.0 and 3.6.0 and both return the same error, so I guess it is something with my network config.