Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mongodb service not running

Tags:

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/

like image 630
Anthony Avatar asked Feb 02 '16 21:02

Anthony


People also ask

Why is MongoDB not running?

We found that the reason for this error was the dbpath variable in /etc/mongodb. conf. Previously, the default value for dbpath was /data/db. The upstart job mongodb(which comes with mongodb-10gen package) invokes the mongod with –config /etc/mongodb.

How do I know if MongoDB is running as a service?

To verify the status of the service, type: sudo systemctl status mongodb.


1 Answers

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.

like image 134
justcompile Avatar answered Nov 03 '22 00:11

justcompile