0

new to this ..so my MONGOD unexpectedly shutdown and i can't seem to repair it ..this is what i see when i try to start up ./mongod

**2018-04-21T19:59:06.237+0000 ** WARNING: --rest is specified without --httpinterface,
2018-04-21T19:59:06.238+0000 **          enabling http interface
warning: bind_ip of 0.0.0.0 is unnecessary; listens on all ips by default
2018-04-21T19:59:06.241+0000 [initandlisten] MongoDB starting : pid=2848 port=27017 dbpath=data 64-bit host=omarr11-webdevbootcamp-5900192
2018-04-21T19:59:06.241+0000 [initandlisten] db version v2.6.12
2018-04-21T19:59:06.241+0000 [initandlisten] git version: d73c92b1c85703828b55c2916a5dd4ad46535f6a
2018-04-21T19:59:06.241+0000 [initandlisten] build info: Linux build5.ny.cbi.10gen.cc 2.6.32-431.3.1.el6.x86_64 #1 SMP Fri Jan 3 21:39:27 UTC 2014 x86_64 BOOST_LIB_VERSION=1_49
2018-04-21T19:59:06.241+0000 [initandlisten] allocator: tcmalloc
2018-04-21T19:59:06.241+0000 [initandlisten] options: { net: { bindIp: "0.0.0.0", http: { RESTInterfaceEnabled: true, enabled: true } }, storage: { dbPath: "data", journal: { enabled: false } } }
************** 
Unclean shutdown detected.
Please visit http://dochub.mongodb.org/core/repair for recovery instructions.
*************
2018-04-21T19:59:06.241+0000 [initandlisten] exception in initAndListen: 12596 old lock file, terminating
2018-04-21T19:59:06.241+0000 [initandlisten] dbexit: 
2018-04-21T19:59:06.241+0000 [initandlisten] shutdown: going to close listening sockets...
2018-04-21T19:59:06.241+0000 [initandlisten] shutdown: going to flush diaglog...
2018-04-21T19:59:06.241+0000 [initandlisten] shutdown: going to close sockets...
2018-04-21T19:59:06.241+0000 [initandlisten] shutdown: waiting for fs preallocator...
2018-04-21T19:59:06.242+0000 [initandlisten] shutdown: closing all files...
2018-04-21T19:59:06.242+0000 [initandlisten] closeAllFiles() finished
2018-04-21T19:59:06.242+0000 [initandlisten] dbexit: really exiting now**

can someone help me repair this please?

Azeeo
  • 3
  • 3
  • Possible duplicate of [MongoDB won't start after server crash](https://stackoverflow.com/questions/13700261/mongodb-wont-start-after-server-crash) – Ian Mercer Apr 21 '18 at 20:15
  • Have you tried the suggested approach ("Please visit http://dochub.mongodb.org/core/repair for recovery instructions.")? It appears that you have disabled the journal, so your best recovery option (aside from restoring from a backup) is to run the database repair command as per the link in your log output. Make sure you take a backup of your data files before attempting any repair. I would strongly recommend leaving the journal enabled and upgrading to a supported version of MongoDB (2.6 reached end-of-life in Oct, 2016). – Stennie Apr 21 '18 at 21:39
  • hi Stennie.. thanks for the reply.. yes i have tried that and i still have not been able to solve the problem.. im new to this so i actually don't know how i would enable journal.. can you guide me through to enable journal? – Azeeo Apr 22 '18 at 04:18
  • got it to work! ..it was the mongod.lock file that needed to be deleted ..its working fine now.. thanks – Azeeo Apr 22 '18 at 17:25

1 Answers1

0

You should look for the lock file (mongod.lock) in the data folder of the mongodb and you need to delete it and try to start again.

In case you have some data corruption issue you can try repair option https://docs.mongodb.com/manual/tutorial/recover-data-following-unexpected-shutdown/ . But in case it is just normal course of learning deleting the mongod.lock file should start the mongod process again...

Devesh
  • 4,500
  • 1
  • 17
  • 28
  • Hey Devesh ..that's exactly what the problem was.. i cd into data ..found the "mongod.lock" file and deleted it ..it working now.. thanks – Azeeo Apr 22 '18 at 17:24