0

I'm trying to configure windows 7 (32 bit) service for MongoDB with that cmd command: mongod.exe -f mongo.conf --install --serviceName mongoDB --serviceDisplayName "MongoDB windows service" --serviceDescription "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?
konfortes
  • 99
  • 1
  • 2
  • 8
  • possible duplicate of [How to install MongoDB as service on Windows 8.1](http://stackoverflow.com/questions/22969325/how-to-install-mongodb-as-service-on-windows-8-1) – WiredPrairie Apr 14 '14 at 10:41
  • It's likely you're hitting the same bug as in the other question. – WiredPrairie Apr 14 '14 at 10:42

1 Answers1

0

Use the full path in the -f argument:

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

(caveat: I haven't tried this with whitespaces in the folder names)

Services working directory isn't the directory that you install them from or that their exe resides in, but the %windir%\system32 directory.

Community
  • 1
  • 1
mnemosyn
  • 45,391
  • 6
  • 76
  • 82