Mongodb Replica Set

I’m trying to setup a small replica set on the docker for mac beta, however I’ve tried multiple ways to add members to the replicaset:

var cfg = rs.conf()
cfg = {_id:"rs0", members: [{"_id":0, "host":"mongodb:27017"},{"_id":1, "host":"mongodb2:27017"}]}

rs.reconfig(cfg, {force: true})

This works internally as the hostnames match on the containers, and they are able to communicate with each other however my mac cannot connect to them using the hostname, or IP address as mongo automatically tries to use the specified hostname as provided. Before trying out the beta I’ve been using Weave which works fine and allows hostnames to work without issue between networks (On that specific docker host I setup the replica set to use the VM’s IP address)

Does anyone know of the proper way to do this? I’m able to connect directly to each node using, but not the replica set as a whole.

Not try on Mac. One possible reason is the bindIp in mongod.conf. Probably it binds, comments it out so mongod will listen on This may help to solve the issue.