mongod unclean shutdown detected

10,542

Solution 1

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.

Solution 2

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.

Share:
10,542
ccfarre
Author by

ccfarre

Updated on June 27, 2022

Comments

  • ccfarre
    ccfarre almost 2 years

    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?

  • Derek Soike
    Derek Soike over 8 years
    Are you sure the lock file is actually being deleted? Make sure you have permission to remove the file and check that it's gone before trying to restart mongod.
  • ccfarre
    ccfarre over 8 years
    Yes, I'm sure. The mongod.lock file (sized 1kb) disappears but I get the same error message. Furthermore, the file appears again after trying to run mongod.exe (sized 0kb)
  • Markus W Mahlberg
    Markus W Mahlberg over 8 years
    Derek, read the error message. mongod explicitly states when there is a problem with the lock file. We have a journaling problem here.