如何将MongoDB作为Windows服务运行?
问题描述:
如何设置MongoDB,使其可以作为Windows服务运行?
How can I set up MongoDB so it can run as a Windows service?
答
我认为,如果您使用--install
命令行开关运行它,则会将其安装为Windows服务.
I think if you run it with the --install
command line switch, it installs it as a Windows Service.
mongod --install
可能值得首先阅读此线程尽管.写入相关的注册表项时,相对/绝对路径似乎存在一些问题.
It might be worth reading this thread first though. There seems to be some problems with relative/absolute paths when the relevant registry key gets written.