Failed to connect mongodb server

asked 2016-07-04 08:54:34 -0500

updated 2016-07-05 09:00:48 -0500

 arjan@controller:~$ mongo
MongoDB shell version: 2.4.9
connecting to: test
Mon Jul  4 06:17:02.603 Error: couldn't connect to server at src/mongo/shell/mongo.js:145
exception: connect failed

I cannot connect to mongo database to install telemetry services

I have tried the following: stop the mongodb service deleting /var/lib/mongodb/mongodb.lock then repairing the database by mongod --repair and then start the mongodb service again

It didn't work the mongodb.lock file appears any how.

Please help

edit retag flag offensive close merge delete


You may want to pull the mongo logs and post them to then add it to the ticket. Other issues similar to this said that the user needed to remove the current lock file, then restart, but I don't know if that will resolve it.

mpetason gravatar imagempetason ( 2016-07-06 13:32:21 -0500 )edit (Logs pasted)

computeforce gravatar imagecomputeforce ( 2016-07-09 03:08:00 -0500 )edit

Be sure the directory /data/db has mongodb as owner. All files in that directory should have mongodb owner and group. Also if selinux is enforcing, set context on /data/db recursively to system_u:object_r:mongod_var_lib_t.

barry.davis gravatar imagebarry.davis ( 2016-07-09 08:41:17 -0500 )edit