Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-13515

Cannot install MongoDB as a service on Windows

    • ALL
    • Hide

      Install MongoDB 2.6 to c:\mongodb

      create c:\mongodb\bin\data\db
      create c:\mongodb\bin\logs

      create mongod.cfg file with logpath and dbpath specified:

      dbpath=c:\mongodb\bin\data\db
      logpath=c:\mongodb\bin\logs\mongo.log

      open cmd prompt as admin

      cd \mongodb

      run:
      mongod --config C:\mongodb\bin\mongod.cfg --install

      Show
      Install MongoDB 2.6 to c:\mongodb create c:\mongodb\bin\data\db create c:\mongodb\bin\logs create mongod.cfg file with logpath and dbpath specified: dbpath=c:\mongodb\bin\data\db logpath=c:\mongodb\bin\logs\mongo.log open cmd prompt as admin cd \mongodb run: mongod --config C:\mongodb\bin\mongod.cfg --install

      Issue Status as of May 07, 2014

      ISSUE SUMMARY
      The server options were canonicalized for 2.6 (SERVER-13379) to ensure compatibility between config file and parsed command line options. An oversight in the Windows service code regarding this change made it impossible to use the --install option to install MongoDB as a service on Windows.

      USER IMPACT
      Users upgrading to 2.6.0 were unable to install MongoDB as a service automatically and have to revert to a more complex manual process.

      WORKAROUNDS
      The service can be installed manually. The details of this workaround are described in this comment and on our documentation page Install MongoDB on Windows.

      RESOLUTION
      The changes from SERVER-13379 impact the Windows service code and have to be applied there as well.

      AFFECTED VERSIONS
      Version 2.6.0 is affected by this bug.

      PATCHES
      The patch is included in the 2.6.1 production release.

      Original description.

      Using the MongoDB 2.6 standard installer:

      The instructions on the website say that this command should work:

      mongod --config C:\mongodb\bin\mongod.cfg --install

      mongod.cfg has dbpath and logpath set in it.

      But that writes this to the mongo.log file:

      2014-04-08T12:57:51.296-0700 --install has to be used with --logpath

      So I tried this:

      mongod --config C:\mongodb\bin\mongod.cfg --logpath C:\mongodb\bin\logs\mongo.log --install

      I still get the same log message about needing --logpath

            Assignee:
            sverch Shaun Verch
            Reporter:
            slolife Chris Becker
            Votes:
            2 Vote for this issue
            Watchers:
            21 Start watching this issue

              Created:
              Updated:
              Resolved: