How to setup MongoDB so it can run as Windows service?
相关问题
- MongoDB can not create unique sparse index (duplic
- Spring Data MongoDB - lazy access to some fields
- Golang mongodb aggregation
- Why does a windows service, hosting an NserviceBus
- How to convert from Timestamp to Mongo ObjectID
相关文章
- mongodb有没有什么办法禁止读取数据的时候进行缓存
- mongodb-aggregate聚合查询分组后如何获得多字段
- mongodb error: how do I make sure that your journa
- How to track MongoDB requests from a console appli
- XCopy or MOVE do not work when a WCF Service runs
- MongoError: cannot infer query fields to set, path
- Pymongo $in Query Not Working
- Problem installing windows service
The recommended way
mongod --install
results in error:After having installed mongodb in
C:\mongodb
you need to simply add the logpath:The path to the logfile must exist and it must be an absolute Windows path. Then you start the MongoDB service by typing:
I'm on version 2.4.9 and using a config file. The service wouldn't start until I surrounded the equals sign in the config file with spaces:
Originally I had:
I also discovered that when installing the service that you have to use an absolute path for the config file eg:
Don't be tempted to put inverted commas around a dbpath with spaces. The service will appear to start when you execute net start MongoDB but it will terminate. Check the log files for confirmation that the service has really started.