I cannot install mongodb as a windows service.

708 views
Skip to first unread message

Han Yan

unread,
Apr 8, 2014, 2:47:54 PM4/8/14
to mongod...@googlegroups.com
The command I use: mongod --logpath c:\mongodb\mongodb.log --logappend --serviceName mongodb --install
I want to upgrade from 2.4.8 to 2.6, I deleted old one and keep config and log file the same. 

Any thing wrong? 

Stig Nielsson

unread,
Apr 8, 2014, 4:10:49 PM4/8/14
to mongod...@googlegroups.com
I cannot install 2.6 as a service either. I keep getting error about --logpath has to be used when using --install parameter for mongod.exe.

I am an Window 7 pro 64 bit and have tried both the MSI installer and the Zip file for 64 bit windows.

I have tried both by making a cfg file containing a logpath variable and by specifying --logpath on the cmd line. It seems to work, but when I look in the config file, I just see this one line saying that --logpath has to be specified when specifying --install.

I can run mongod from the commandline without any problemes.

So what to do to get a mongo 2.6 installed as a service ?

(I used to have no problems installing 2.4 as a service. )

/Stig

Chris Becker

unread,
Apr 8, 2014, 4:22:14 PM4/8/14
to mongod...@googlegroups.com

Jeb Wilson

unread,
Apr 8, 2014, 7:08:45 PM4/8/14
to mongod...@googlegroups.com
Ugh. No workaround per the JIRA ticket. How soon do you think they'll fix this?

Stephen Steneker

unread,
Apr 8, 2014, 8:43:28 PM4/8/14
to mongod...@googlegroups.com
Hi all,

Apologies for the inconvenience .. we're working on a fix for this issue.

Since this is specific to the --install option on Windows, there is a workaround that we've just tested:
 - Install a previous version of MongoDB (eg. 2.4.9) as a service
 - Upgrade to 2.6.0 by stopping the service, replacing the previous binaries with 2.6.0 ones, and starting the service again

Regards,
Stephen

Asya Kamsky

unread,
Apr 10, 2014, 1:58:15 AM4/10/14
to mongodb-user
You can also work around this by creating the service by hand:

sc create mongodb binPath="c:\mongodb\mongodb.exe --service
<Add_Additional_Parameters>"
> --
> You received this message because you are subscribed to the Google Groups
> "mongodb-user"
> group.
>
> For other MongoDB technical support options, see:
> http://www.mongodb.org/about/support/.
> ---
> You received this message because you are subscribed to the Google Groups
> "mongodb-user" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to mongodb-user...@googlegroups.com.
> To post to this group, send email to mongod...@googlegroups.com.
> Visit this group at http://groups.google.com/group/mongodb-user.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/mongodb-user/072c7595-4bae-4cd9-875c-66a6439baa29%40googlegroups.com.
>
> For more options, visit https://groups.google.com/d/optout.

Stephen Steneker

unread,
Apr 10, 2014, 9:47:20 PM4/10/14
to mongod...@googlegroups.com
On Thursday, 10 April 2014 15:58:15 UTC+10, Asya Kamsky wrote:
You can also work around this by creating the service by hand:

sc create mongodb binPath="c:\mongodb\mongodb.exe --service
<Add_Additional_Parameters>"

FYI, I've added more detailed instructions on manually creating the service definition in a comment on the server issue, including using a config file: https://jira.mongodb.org/browse/SERVER-13515.

Note that the "sc" command has some usage quirks .. in particular, a space is required between an option and its value (per http://technet.microsoft.com/en-us/library/cc990289.aspx).

My TL;DR usage example with the standard path used by the MongoDB 2.6 MSI install is to run the following from an Administrator cmd prompt:

sc create MongoDB binPath= "\"C:\Program Files\MongoDB 2.6 Standard\bin\mongod.exe\" --service --config=\"C:\Program Files\MongoDB 2.6 Standard\mongod.cfg\"" DisplayName= "MongoDB 2.6 Standard" start= "auto"

Please see SERVER-13515 for the full steps.
 
Thanks,
Stephen

Hu Swing

unread,
Apr 12, 2014, 9:13:28 PM4/12/14
to mongod...@googlegroups.com
Yes,i also  meet this problem ,So I look up in the bug report dashboard ,then I found this is a bug for mongodb 2.6.

Stephen Steneker

unread,
Apr 13, 2014, 8:09:08 PM4/13/14
to mongod...@googlegroups.com
On Sunday, 13 April 2014 11:13:28 UTC+10, Hu Swing wrote:
Yes,i also  meet this problem ,So I look up in the bug report dashboard ,then I found this is a bug for mongodb 2.6.

Hi,

Yes, there is a problem installing MongoDB 2.6.0 as a Windows service with --install as per the earlier comments on this thread .. and you can find a workaround on the server issue:
 https://jira.mongodb.org/browse/SERVER-13515

Per the Jira issue, a fix has been committed for the next server release (2.6.1).

Thanks,
Stephen

Christoph Bussler

unread,
Apr 15, 2014, 9:59:45 AM4/15/14
to mongod...@googlegroups.com
Please put this into the mongodb installation document so people don't waste their time trying to setup a service. The instructions claim that it works. I also would put in a test case for the installation document so it gets tested every time the software gets a new release.

Sree Nayan

unread,
Apr 15, 2014, 1:04:27 PM4/15/14
to mongod...@googlegroups.com
That is good idea, took me  a day to figure out the bug, had to use previous version to create the window service.
-Srini

Stephen Steneker

unread,
Apr 15, 2014, 9:52:46 PM4/15/14
to mongod...@googlegroups.com
On Tuesday, 15 April 2014 23:59:45 UTC+10, Christoph Bussler wrote:
Please put this into the mongodb installation document so people don't waste their time trying to setup a service. The instructions claim that it works. I also would put in a test case for the installation document so it gets tested every time the software gets a new release.

Hi Christoph, Sree,

Agreed .. thanks for the feedback. I thought there was already a DOCS ticket to add reference to SERVER-13515 and manual workaround in the Windows --install instructions. I couldn't find one so have added: https://jira.mongodb.org/browse/DOCS-3182.

Regards,
Stephen

Reply all
Reply to author
Forward
0 new messages