2014-04-14 168 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