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 access mongodb using private ip from another droplet on Ubuntu.
I want to connect to mongodb on droplet from another droplet.
I have disabled firewall to get it out of equation.
I have set “bindIp” to the private ip of the droplet in mongodb.conf.
Now from another droplet, which also has private networking enabled I do
mongo –host PRIVATE-IP
but doen’t connect, I am getting this is return:
connecting to: PRIVATEIP:27017/test
2017-12-26T04:41:53.102-0500 Error: couldn’t connect to server PRIVATEIP:27017 (PRIVATE_IP), connection attempt failed at src/mongo/shell/mongo.js:148
exception: connect failed
Can anyone please advice what I am doing wrong?
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.×