如何将 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.