4

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?

BatScream
  • 19,260
  • 4
  • 52
  • 68
ccfarre
  • 49
  • 1
  • 1
  • 5
  • I don't know if this would break something (since I don't know MongoDB), but would it help to delete all the journal files you can find and then starting again using the `--journal` flag? Just I wild guess, and don't beat me if that screws up your installation :) – Hexaholic Dec 16 '15 at 18:28
  • Well you still need to run `mongod.exe --repair` after deleting `mongod.lock` – styvane Dec 16 '15 at 18:32
  • Do not delete the journal files. Try starting with the `--journal` option enabled, as indicated in the error message. Everything should be fine. – BatScream Dec 16 '15 at 18:38
  • I tried to delete the .lock file and running with --repair but it did not work. – ccfarre Dec 16 '15 at 18:52
  • I'm voting to close this question as off-topic because it shows zero effort in reading the manual or for the fact the error message thrown. – BatScream Dec 17 '15 at 08:52

5 Answers5

6

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.

TofferJ
  • 4,678
  • 1
  • 37
  • 49
1

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.

Markus W Mahlberg
  • 19,711
  • 6
  • 65
  • 89
0

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

0

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.

Ivan Vovk
  • 929
  • 14
  • 28
-1

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

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

Derek Soike
  • 11,238
  • 3
  • 79
  • 74
  • 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. – Derek Soike Dec 16 '15 at 18:54
  • 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) – ccfarre Dec 16 '15 at 19:06
  • Derek, read the error message. `mongod` explicitly states when there is a problem with the lock file. We have a journaling problem here. – Markus W Mahlberg Dec 16 '15 at 20:29