On Installing MongoDB as a Service on Windows

A few notes to save you some headaches while installing MongoDB as a service on Windows… It seems that it’s common to encounter the results below, so these are some things to remember.

Sat May 01 11:52:40 dbexit:
Sat May 01 11:52:40 shutdown: going to close listening sockets…
Sat May 01 11:52:40 shutdown: going to flush oplog…
Sat May 01 11:52:40 shutdown: going to close sockets…
Sat May 01 11:52:40 shutdown: waiting for fs preallocator…
Sat May 01 11:52:40 shutdown: closing all files…
Sat May 01 11:52:40 closeAllFiles() finished
Sat May 01 11:52:40 dbexit: really exiting now

  1. Create the data directory, by default that’s c:\data\db\
  2. It’s easy to forget, so remember to run cmd as Administrator! You won’t get UAC warnings, just the failures above.
  3. Install with the full path “c:\Program Files\mongodb-win32-x86_64-1.4.2\bin\mongod.exe” –install. If you don’t, the registry setting for the service won’t include the full path
  4. If you install from a path with spaces (i.e., Program Files) you’ll need to make sure it’s quoted in the registry (HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\MongoDB\ImagePath)

More on MongoDB in a later post…

This entry was posted in Uncategorized and tagged , . Bookmark the permalink.

4 Responses to On Installing MongoDB as a Service on Windows

  1. John,

    I suggest that you try out mongo 1.6.1. Windows service support has improved greatly. The 10gen guys have been improving windows support and I submitted a few fixes.

    Unfortunately, mongos does not have windows service support. I will be fixing that.

    If you find any other problems with mongodb on windows, open a bug, and let me know about it. Even if I don’t fix it myelf I’ll vote for if its legitimate.

    Justin

  2. Micah says:

    Good call on the regedit

  3. Sadiya says:

    Thanks John! This is helping me to install Mongo on a new server!

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">