ccfarre
ccfarre

Reputation: 49

mongod unclean shutdown detected

I try to start mongod.exe but I have and I get the following error:

C:\MongoDB\Server\30\bin>mongod.exe 
2015-12-16T19:12:17.108+0100 I CONTROL 2015-12-16T19:12:17.110+0100 W CONTROL  32-bit servers don't have journaling enabled by default. 
Please use --journal if you want durability.
2015-12-16T19:12:17.110+0100 I CONTROL 
2015-12-16T19:12:17.120+0100 I CONTROL  Hotfix KB2731284 or later update is not installed, will zero-out data files 
2015-12-16T19:12:17.132+0100 I STORAGE  [initandlisten] ************** 
2015-12-16T19:12:17.132+0100 I STORAGE  [initandlisten] Error: journal files are present in journal directory, yet starting without journaling enabled.
2015-12-16T19:12:17.133+0100 I STORAGE  [initandlisten] It is recommended that you start with journaling enabled so that recovery may occur.
2015-12-16T19:12:17.133+0100 I STORAGE  [initandlisten] **************
2015-12-16T19:12:17.135+0100 I STORAGE  [initandlisten] exception in initAndListen: 13597 can't start without --journal enabled when journal/ files are present, terminating
2015-12-16T19:12:17.135+0100 I CONTROL  [initandlisten] dbexit:  rc: 100

I also tried to run it with --repair but then I get the same error.

Finally, I tried to delete the mongod.lock file but I still get the error.

How should I fix the unclean shutdown?

Upvotes: 4

Views: 13442

Answers (5)

Ivan Vovk
Ivan Vovk

Reputation: 1039

Same error.

It' permission issue. If you get this error on Windows platform you should do all operations with administrator privilegies.

On Linux run

mongod --repair

but you should run it with sudo or under root. If under root you should change ownership of the files in data DB directory. Do it carefully or another error will appear.

Upvotes: 0

Gunnar Beister
Gunnar Beister

Reputation: 1

start cmd shell as admin and call start_mongo. This should fix it

Upvotes: 0

Saloni Malhotra
Saloni Malhotra

Reputation: 71

The solution to this problem is mongod --repair. This command automatically shuts down the all processes and repairs Mongodb issues. You can find more details in the official documentation.

Upvotes: 6

Markus W Mahlberg
Markus W Mahlberg

Reputation: 20722

Ok, to get some confusion right here. Journal files are not there to annoy you. They hold data not yet applied to the datafiles, but already received and acknowledged by the server. The mongod process finished a request after applying the data to the journal, but before applying them to the data files. This behavior is configured by the chosen write concern.

Bottom line: special measurements were taken to make the data in the journal durable, you should not ignore that.

So you should create a configuration file containing this (among other things, if one already exists):

storage:
 journal:
   enabled: true

Please follow the documentation on running MongoDB on windows to the letter. Adjust the configuration file with options according to your needs.

If you are absolutely, positively sure that you do not need journaling, you can start mongodb with the --journal command line option just once, shut the instance down after the journal was successfully applied and remove the journal files then. Expect any write with a write concern involving the journal to fail, however.

Note 1 You are using the 32-bit version of MongoDB, which is only suitable for testing. Note that the 32-bit version only supports up to 2Gb of data.

Note 2 MongoDB is VERY well documented. You really should read the manual from top to bottom – it get's you started fast enough with providing a lot of information on the internals.

Upvotes: 1

Derek Soike
Derek Soike

Reputation: 11680

Try removing the lock file, then running with --repair.

Here's what the Mongo Docs say about recovering data / restarting after an unexpected shutdown.

Upvotes: -1

Related Questions