简体   繁体   中英

sudo service mongod start failed on RHEL system

I have followed the instructions on MongoDB's website to install MongoDB on RHEL systems. Whenever I use the command sudo service mongod start I get the message Starting mongod: [FAILED] . Does anyone know what I am doing wrong? I already changed the permissions to the /var/lib/mongo and /var/log/mongodb directories.

In addition, this is what my log file reads for the last time I tried to start mongoDB

2014-11-28T16:52:42.532-0600 ***** SERVER RESTARTED *****
2014-11-28T16:52:42.535-0600 [initandlisten] MongoDB starting : pid=2846 port=27017 dbpath=/var/lib/mongo$
2014-11-28T16:52:42.535-0600 [initandlisten] db version v2.6.5
2014-11-28T16:52:42.535-0600 [initandlisten] git version: e99d4fcb4279c0279796f237aa92fe3b64560bf6
2014-11-28T16:52:42.535-0600 [initandlisten] build info: Linux build8.nj1.10gen.cc 2.6.32-431.3.1.el6.x86$
2014-11-28T16:52:42.535-0600 [initandlisten] allocator: tcmalloc
2014-11-28T16:52:42.535-0600 [initandlisten] options: { config: "/etc/mongod.conf", net: { bindIp: "127.0$
2014-11-28T16:52:42.535-0600 [initandlisten] exception in initAndListen: 10310 Unable to lock file: /var/$
2014-11-28T16:52:42.535-0600 [initandlisten] dbexit:
2014-11-28T16:52:42.535-0600 [initandlisten] shutdown: going to close listening sockets...
2014-11-28T16:52:42.535-0600 [initandlisten] shutdown: going to flush diaglog...
2014-11-28T16:52:42.535-0600 [initandlisten] shutdown: going to close sockets...
2014-11-28T16:52:42.535-0600 [initandlisten] shutdown: waiting for fs preallocator...
2014-11-28T16:52:42.535-0600 [initandlisten] shutdown: lock for final commit...
2014-11-28T16:52:42.535-0600 [initandlisten] shutdown: final commit...
2014-11-28T16:52:42.536-0600 [initandlisten] shutdown: closing all files...
2014-11-28T16:52:42.536-0600 [initandlisten] closeAllFiles() finished
2014-11-28T16:52:42.536-0600 [initandlisten] dbexit: really exiting now

that looks very similar to the output when you have a mongo already running.

probably you have a startup script installed in /etc/init.d/mongod

Your log file is clipped. Please include an unclipped version where we can see the entire line. From what's there, mongod couldn't lock something, which likely means you already have a mongod running in that directory or the permissions aren't set to allow mongod to take the lock.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM