Home:ALL Converter>MongoDB replica set initiate() failing on Docker

MongoDB replica set initiate() failing on Docker

Ask Time:2017-12-19T09:47:20         Author:ClonedOne

Json Formatter

I am trying to set up a MongoDB replica set on Docker follwoing this guide. However when I get to the rs.intitate() command, I get an error.

"errmsg" : "replSetInitiate quorum check failed because not all proposed set members responded affirmatively: mongo-local-002:27017 failed with Connection refused, mongo-local-003:27017 failed with Connection refused"

edit: using latest version of docker container (3.6)

edit2: the problem is actually with mongo 3.6 (3.4 works). I have tried binding each replica ip to an ip in the docker network, however in this way I am not able to open the mongo console on the main replica (it says connection refused) even passing the IP instead of the replica name.

Does anyone know what I am missing here?

Author:ClonedOne,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/47878922/mongodb-replica-set-initiate-failing-on-docker
yy