Join 1M+ other developers and:
- Get help and share knowledge in Q&A
- Subscribe to topics of interest
- Get courses & tools that help you grow as a developer or small business owner
How to set up bindIp for a replica set?
I am using the Ubuntu 18.04 MongoDB one click installation droplet. I have setup three droplets, and want to set up a replica set.
I was trying to follow some tutorials:
I am stuck at setting a bindIp, and whenever I add the IP of my other droplets to bindIp, mongod won’t start, failing with this error:
Mar 31 15:52:01 db3.muhive.com systemd: mongod.service: Main process exited, code=exited, status=48/n/a Mar 31 15:52:01 db3.muhive.com systemd: mongod.service: Failed with result 'exit-code'.
To be clear, this works:
# network interfaces net: port: 27017 bindIp: 127.0.0.1
but this doesn’t
# network interfaces net: port: 27017 bindIp: 127.0.0.1,db1.munhive.com,db2.munhive.com,db3.munhive.com
Pinging each of those individually does work though. How do I set this up? Do I need to configure a private network?
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.×