Mongodb error on starting

mongodb service not starting windows
start mongodb ubuntu
failed to start mongodb database server
mongodb not starting windows
failed to start mongodb database server centos 7
unable to start mongodb
error starting mongod. /var/run/mongodb/mongod.pid exists.
failed to start mongodb.service: unit not found.

When i start mongo db it instantly crashes and goes back to the normal command line. I am on Mac runing the MEAN stack if that helps. Below is the error:

$sudo mongod

Sun Jun  1 21:01:01.728 [initandlisten] MongoDB starting : pid=47937 port=3000 dbpath=/usr/local/var/mongodb 64-bit host=NoHax4You
Sun Jun  1 21:01:01.728 [initandlisten] 
Sun Jun  1 21:01:01.729 [initandlisten] ** WARNING: soft rlimits too low. Number of files is 256, should be at least 1000
Sun Jun  1 21:01:01.729 [initandlisten] db version v2.4.9
Sun Jun  1 21:01:01.729 [initandlisten] git version: nogitversion
Sun Jun  1 21:01:01.729 [initandlisten] build info: Darwin minimavericks.local 13.0.0 Darwin Kernel Version 13.0.0: Thu Sep 19 22:22:27 PDT 2013; root:xnu-2422.1.72~6/RELEASE_X86_64 x86_64 BOOST_LIB_VERSION=1_49
Sun Jun  1 21:01:01.729 [initandlisten] allocator: tcmalloc
Sun Jun  1 21:01:01.729 [initandlisten] options: { bind_ip: "127.0.0.1", config: "/usr/local/etc/mongod.conf", dbpath: "/usr/local/var/mongodb", logappend: "true", logpath: "/usr/local/var/log/mongodb/mongo.log", port: 3000 }
Sun Jun  1 21:01:01.729 [initandlisten] exception in initAndListen: 10310 Unable to lock file: /usr/local/var/mongodb/mongod.lock. Is a mongod instance already running?, terminating
Sun Jun  1 21:01:01.729 dbexit: 
Sun Jun  1 21:01:01.729 [initandlisten] shutdown: going to close listening sockets...
Sun Jun  1 21:01:01.729 [initandlisten] shutdown: going to flush diaglog...
Sun Jun  1 21:01:01.729 [initandlisten] shutdown: going to close sockets...
Sun Jun  1 21:01:01.729 [initandlisten] shutdown: waiting for fs preallocator...
Sun Jun  1 21:01:01.729 [initandlisten] shutdown: lock for final commit...
Sun Jun  1 21:01:01.729 [initandlisten] shutdown: final commit...
Sun Jun  1 21:01:01.729 [initandlisten] shutdown: closing all files...
Sun Jun  1 21:01:01.729 [initandlisten] closeAllFiles() finished
Sun Jun  1 21:01:01.729 dbexit: really exiting now

Thanks, Ewan


First of all, look for other instances of mongod running on the system using the age-old command:

ps ax | grep mongod

If you see a line like -

98555   ??  S      4:40.89 mongod --dbpath /Volumes/ComputerName/data/db 
-PID-                      -name-          -------------path------------

then there is a mongod process running already. If so kill it and then start mongod again.

To kill a process with PID = 0000, in Unix like environment use -

kill -9 0000

If your console returns something like, -bash: kill: (98555) - Operation not permitted, use

sudo !! 

to repeat the command as super user. This should get you going.


PS: If you haven't stored any data in your db yet, delete /data and then create the /data/db directory again. Do a sudo mongod and it should work.

mongodb service is not starting up, Removing the lock file didn't help, and we were getting errors in the log file mongod -f /etc/mongodb.conf --repair sudo service mongodb start. After running the repair I was able to start the mongod proccessor but as root, which meant that service mongod start would not work. To repair this issue, I needed to make sure that all the files inside the database folder were owned and grouped to mongod. I did this by the following: Check the file permissions inside your database folder


I had the same issue, and this one liner fix my issue

killall mongod

Run the above command inside your Terminal

Hope that helps!

14.04 - Fail to start mongod service but mongodb service, We used to run mongod service (sudo service mongod start) however recently when re run mongod service, we got the error above. However this� mongod --fork --logpath /var/log/mongodb.log On a amazon ec2 32 bit instance (Amazon Linux AMI release 2014.09), I run into the following error: 2015-02-18T18:14:09.007+0000


I first opened the /data/db/mongod.lock file, found my process number there, then killed it with kill -9 <processnumber>. That worked for me.

mongod service not starting, With a binding error like that you have two major options: sudo rm /var/lib/ mongodb/mongod.lock sudo mongod --repair sudo service mongod start sudo� Returned by MongoDB applications which encounter an unrecoverable error, an uncaught exception or uncaught signal. The system exits without performing a clean shutdown. 20 ¶


Troubleshoot "Mongodb not able to start" Error on CCO, Once you trying to start MongoDB service it throws this error. service mongod start. And the error is. Job for mongod.service failed. See "systemctl� There is no db folder in the d:/mongodb Directory. You need to create one by yourself. At this time, the mongod process runs and then open a cmd window and enter:


Recover a Standalone after an Unexpected Shutdown — MongoDB , Starting in MongoDB 4.0.3, for the WiredTiger storage engine, mongod --repair : To repair the data files, start the mongod instance with the --repair option. Now you can start, stop, restart mongo server as usual windows service choose your favorite way from this: from Control Panel -> Administration -> Services -> MongoDB by command execution from command line as admin: ( net start MongoDB)


Exit Codes and Statuses — MongoDB Manual, Message: NT Service Error. Returned by MongoDB applications for Windows due to failures installing, starting or removing the NT Service for the application. Further optimization can occur if the regular expression is a “prefix expression”, which means that all potential matches start with the same string. This allows MongoDB to construct a “range” from that prefix and only match against those values from the index that fall within that range.