2014-04-14 125 views
0

我想用该cmd命令为MongoDB配置windows 7(32位)服务: mongod.exe -f mongo.conf --install --serviceName mongoDB --serviceDisplayName“MongoDB windows service “--serviceDescription ”MongoDB的“MongoDB窗口服务安装

-f mongo.conf is a reference to my configuration file located in the same directory with mongod.exe. 
this is how my mongo.conf looks like: 
dbpath = C:\Program Files\MongoDB 2.6 Standard\data 
logpath = C:\Program Files\MongoDB 2.6 Standard\logs\mongo.log 
port = 27017 

and yet, when i'm trying to run the command, mongo logs to me: 
--install has to be used with --logpath 

anyone has an idea what is wrong with that? 
+0

[如何在Windows 8.1上将服务安装为MongoDB](http://stackoverflow.com/questions/22969325/how-to-install-mongodb-as-service-on-windows-8-1) – WiredPrairie

+0

您可能会遇到与其他问题相同的错误。 – WiredPrairie

+0

就是这样。谢谢! – konfortes

回答

0

使用在-f参数的完整路径:

--install -f "C:\Program Files\MongoDB 2.6 Standard\mongod.conf" 

0(警告我还没有在该文件夹的名称空格试过这种)

服务工作目录不是您安装它们的目录或其exe文件所在的目录,而是%windir%\system32 directory