Hi,
I’ve setup a droplet with Shared Private Networking enabled. I’ve provisioned it with Ubuntu 12.10 x64. Also, I’ve installed mongodb using ‘sudo apt-get install mongodb’ command.
I tried using mongoose to connect to the mongodb droplet using the default port. It said failed to connect.
I used the command below:
var mongoose = require(‘mongoose’); mongoose.connect(‘mongodb://XXX.XXX.XXX.XXX:27017/database’);
Things I’ve tried…
Any idea what I could try to verify it or what I can do to resolve this?
Cheers, Mickey
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Yes. Here’s the list. <br> <br>-P INPUT ACCEPT <br>-P FORWARD ACCEPT <br>-P OUTPUT ACCEPT <br> <br>Does it means that it accept all ports?
It solved. The bind_ip is set to 127.0.0.1 by default. Need to change it to 0.0.0.0. Cheers.
I also recommend adding an IPTables rule that drops all packets to the MongoDB ports on the eth0 interface: <br><pre>sudo iptables -A INPUT -p tcp -m tcp -i eth0 --dport 27017 -j DROP</pre>
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.