[SERVER-13515] Cannot install MongoDB as a service on Windows Created: 08/Apr/14 Updated: 11/Jul/16 Resolved: 09/Apr/14 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Admin, Usability |
| Affects Version/s: | 2.6.0 |
| Fix Version/s: | 2.6.1, 2.7.0 |
| Type: | Bug | Priority: | Critical - P2 |
| Reporter: | Chris Becker | Assignee: | Shaun Verch |
| Resolution: | Done | Votes: | 2 |
| Labels: | installation, service, windows | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||||||||||||||
| Operating System: | ALL | ||||||||||||||||||||||||||||||||
| Backport Completed: | |||||||||||||||||||||||||||||||||
| Steps To Reproduce: | Install MongoDB 2.6 to c:\mongodb create c:\mongodb\bin\data\db create mongod.cfg file with logpath and dbpath specified: dbpath=c:\mongodb\bin\data\db open cmd prompt as admin cd \mongodb run: |
||||||||||||||||||||||||||||||||
| Participants: | |||||||||||||||||||||||||||||||||
| Description |
|
Issue Status as of May 07, 2014 ISSUE SUMMARY USER IMPACT WORKAROUNDS RESOLUTION AFFECTED VERSIONS PATCHES 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 |
| Comments |
| Comment by Derek Basch [ 18/May/14 ] | |||||||
|
@Sun Lifeng I fixed this error with the technique shown here: | |||||||
| Comment by Sun Lifeng [ 01/May/14 ] | |||||||
|
I use the instruction above ,still got some error like this : 2014-05-01T13:24:00.631+0800 SEVERE: Failed global initialization: FileNotOpen F | |||||||
| Comment by Stennie Steneker (Inactive) [ 10/Apr/14 ] | |||||||
Workaround to install as a serviceYou can manually install 2.6.0 as a service on Windows from an Administrator cmd prompt. Assuming you have installed MongoDB using the MSI installer, the default path will be C:\Program Files\MongoDB 2.6 Standard. If you have installed in an alternative directory you will need to adjust the paths as appropriate. Steps to install:1) Open an Administrator command prompt
2. Make directories for your database and log files
3. Create a configuration file. This file can include any of the configuration options for mongod, but at a minimum must include a valid setting for logpath:
4. Create the MongoDB service
Note that sc.exe requires a space between "=" and the configuration values (eg "binPath= "), and a "\" to escape double quotes. If this works you should see:
5. Start the MongoDB service:
If successful you should be able to connect using the mongo shell. If the service did not start successfully, the log file should contain information to help you troubleshoot. | |||||||
| Comment by Githook User [ 09/Apr/14 ] | |||||||
|
Author: {u'name': u'Shaun Verch', u'email': u'shaun.verch@mongodb.com'}Message: (cherry picked from commit b5c283687ce6c4a753f6c4ddfc5b79c464b23c75) | |||||||
| Comment by Githook User [ 09/Apr/14 ] | |||||||
|
Author: {u'name': u'Shaun Verch', u'email': u'shaun.verch@mongodb.com'}Message: | |||||||
| Comment by Shaun Verch [ 09/Apr/14 ] | |||||||
|
Until this is fixed, there is a workaround that involves using an older binary:
| |||||||
| Comment by Blake Niemyjski [ 09/Apr/14 ] | |||||||
|
I'm also seeing this issue. | |||||||
| Comment by Shaun Verch [ 08/Apr/14 ] | |||||||
|
The internal representation of the options was changed as part of |