5

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/

ΦXocę 웃 Пepeúpa ツ
  • 47,427
  • 17
  • 69
  • 97
Anthony
  • 51
  • 1
  • 2
  • Possible duplicate. Here's is the link for the solution: https://stackoverflow.com/questions/6478113/unable-to-start-mongodb-local-server – Revanth Nov 27 '17 at 06:17

2 Answers2

8

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.

justcompile
  • 3,362
  • 1
  • 29
  • 37
  • What if `ps aux | grep mongo` does return something? Mine did, then running `rm /data/db/mongod.lock` did nothing. Had to reboot to fix the issue. – Tim Biden May 25 '17 at 02:36
  • It means that mongo is running and there would be another reason why you weren't able to connect to it. – justcompile May 31 '17 at 12:46
  • 1
    Why not force kill the process using `pkill` if mongod is still running, assuming that nothing important is being processed? – cjsimon Dec 22 '17 at 01:37
5

Try running pkill mongod to kill the process

GeorgeButter
  • 2,521
  • 1
  • 29
  • 47