Synopsis
mongod.exe 是适用于 Windows 平台的 MongoDB 守护进程版本(即 mongod )。mongod.exe 在类似 UNIX 的平台上具有 mongod 的所有功能,且与其他 mongod 版本完全兼容。此外,mongod.exe 还提供了多个与 Windows 平台本身交互的选项。
该文档仅引用 mongod.exe 特有的选项。mongod.exe 支持所有 mongod 选项,但与 Windows 不兼容的选项除外。关于此处未列出的 mongod 选项的更多信息,请参阅 mongod 和自管理配置文件选项文档。
如需安装和使用 mongod.exe,请阅读在 Windows 上安装 MongoDB Community Edition 文档。
选项
--install将
mongod.exe安装为 Windows 服务并退出。如有需要,您可以为多个
mongod.exe实例安装服务。使用唯一的--serviceName和--serviceDisplayName安装每项服务。仅当存在足够的系统资源并且您的系统设计有需要时才使用多个实例。
--remove删除
mongod.exeWindows 服务。如果mongod.exe正在运行,此操作将停止该服务,然后再删除它。如果您在
--install操作期间配置了非默认--serviceName,则--remove将需要--serviceName。
--reinstall删除
mongod.exe并将mongod.exe作为 Windows 服务重新安装。
--serviceName name默认值:mongodb
设置
mongod.exe作为 Windows 服务运行时的服务名称。请在执行net start <name>和net stop <name>操作时使用此名称。必须将
--serviceName与--install或--remove选项结合使用。
--serviceDescription <description>默认:MongoDB 服务器
设置
mongod.exe服务描述。必须将
--serviceDescription与--install选项结合使用。对于包含空格的说明,必须将说明括在引号中。
--serviceUser <user>在特定用户上下文中运行
mongod.exe服务。该用户必须具有“作为服务登录”的权限。必须将
--serviceUser与--install选项结合使用。
--servicePassword <password>使用
--serviceUser选项运行时,为mongod.exe设置<user>的密码。必须将
--servicePassword与--install选项结合使用。