Unable to connect to mongolab host Unable to connect to mongolab host mongodb mongodb

Unable to connect to mongolab host


It looks like your network is blocking access to that port. I'd recommend contacting your network administrator or trying from a different network.

To test your network connectivity alone (no credentials necessary) you can run this command. This example was run from my unprivileged laptop just now and demonstrates a successful test.

% mongo ds061158.mongolab.com:61158MongoDB shell version: 2.6.1connecting to: ds061158.mongolab.com:61158/testrs-ds061158:PRIMARY> db.runCommand({ping:1});{ "ok" : 1 }rs-ds061158:PRIMARY> exitbye

Our full connectivity troubleshooting guide is here: http://docs.mongolab.com/connecting/#help

Also, feel free to contact us as support@mongolab.com if you'd like us to dig into the specifics of your server or code. We're always happy to help!

Regards,

Jared


I know this question is old, but in case someone still faces a similar issue, this is what helped me:

sudo rm /var/lib/mongodb/mongod.locksudo service mongodb restart


You should try to explicitly specify the port you want to use with the --port option:

mongo ds061158.mongolab.com/order_it --port 61158 -u <dbuser> -p <dbpassword>

From the mongo man pages:

--port <port>
Specifies the port where the mongod or mongos instance is listening. Unless specified mongo connects to mongod instances on port 27017, which is the default mongod port.