I have installed and I am trying to start a MongoDB on CentOS Server 5.11, 32-bit, Plesk 12.5.30.
I have setted some properties on /etc/mongodb.conf:
#where to log
logpath=/var/log/mongodb/mongodb.log
# fork and run in background
fork = true
port = 27017
dbpath = /data/db
pidfilepath=/var/run/mongodb/mongodb.pid
#add config storage as stackoverflow
smallfiles = true
...
The last configuration I have got through this post: Link. But the result was the same…
The log shows this:
Sat Dec 3 12:48:39 db version v1.6.4, pdfile version 4.5
Sat Dec 3 12:48:39 git version: nogitversion
Sat Dec 3 12:48:39 sys info: Linux x86-12.phx2.fedoraproject.org 2.6.32-71.el6$
Sat Dec 3 12:48:39 exception in initAndListen std::exception: dbpath (/var/lib$
Sat Dec 3 12:48:39 dbexit:
Sat Dec 3 12:48:39 shutdown: going to close listening sockets...
Sat Dec 3 12:48:39 shutdown: going to flush oplog...
Sat Dec 3 12:48:39 shutdown: going to close sockets...
Sat Dec 3 12:48:39 shutdown: waiting for fs preallocator...
Sat Dec 3 12:48:39 shutdown: closing all files...
Sat Dec 3 12:48:39 closeAllFiles() finished
Sat Dec 3 12:48:39 dbexit: really exiting now
I tried to start using both commands:
service mongod start
and
mongod --dbpath /data/db --smallfiles
And using the command
service mongod status
The message is
mongod dead but subsys locked
I was following this tutorial and this tutorial. Both of them are not using CentOS 5. Could it be the problem? How can I solve this?
2
Answers
This is for anyone who is getting the status message
mongod dead but subsys locked
and this thread didn’t help. I work on SLC6 (which may be closer to CentOS behavior) with MongoDB v1.6.4, and the following worked for me:Unfortunately, I don’t remember how I figured that out originally (probably logs), but I found it in my root history when I had the problem a second time.
Working solution for mongod dead but subsys locked, remove mongod file form /var/lock/subsys
rm -rf /var/lock/subsys/mongod
and start service mongodb
sudo service mongod start