Mongodb service not running

mongodb

I'm working on this automatic drink dispenser and ran into an issue when I downloaded the Mongo 3.0.7 I tried to run it but I keep getting this error:

I got the idea from this website. http://yujiangtham.com/2014/05/30/build-your-very-own-drink-mixing-robot-part-2/

2016-02-02T15:56:42.585-0500 E NETWORK [initandlisten] listen():
bind() failed errno:48 Address already in use for socket:
0.0.0.0:27017

2016-02-02T15:56:42.585-0500 E NETWORK [initandlisten] addr already
in use 2016-02-02T15:56:42.593-0500 W – [initandlisten]
Detected unclean shutdown – /data/db/mongod.lock is not empty.

2016-02-02T15:56:42.593-0500 I STORAGE [initandlisten] exception in
initAndListen: 98 Unable to lock file: /data/db/mongod.lock errno:35
Resource temporarily unavailable. Is a mongod instance already
running?, terminating

2016-02-02T15:56:42.593-0500 I CONTROL [initandlisten] dbexit: rc:
100

I need help on how to run this. The website I'm using as a reference is
http://yujiangtham.com/2014/05/30/build-your-very-own-drink-mixing-robot-part-2/

Best Answer

It is stating that Mongo is already running. If you are certain it is not, then the lock file still exists from a previous unclean shutdown.

ps aux | grep mongo

if that returns nothing, it will mean the lock file still exists. looking at your error, the file is /data/db/mongod.lock

rm /data/db/mongod.lock

Should get rid of it so you'll be able to start the mongo service running again.