title: MongoDB replica set initiate() failing on Docker
body: <p>I am trying to set up a MongoDB replica set on Docker follwoing this <a href="http://shellfu.com/setting-up-a-mongodb-replica-set-on-docker/" rel="nofollow noreferrer">guide</a>. However when I get to the <code>rs.intitate()</code> command, I get an error.</p>
  
  <pre><code>"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"
  </code></pre>
  
  <p>edit: using latest version of docker container (3.6)</p>
  
  <p>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.</p>
  
  <p>Does anyone know what I am missing here?</p>