On this page
mongod.exe
在本页面
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 社区版文档。
Options
mongod.
exe
--install
``- 将 mongod.exe 作为 Windows 服务安装并退出。
如果需要,您可以为 mongod.exe 的多个实例安装服务。使用唯一的--serviceName和--serviceDisplayName安装每个服务。仅当存在足够的系统资源并且您的系统设计需要它时才使用多个实例。
--remove
``- 删除 mongod.exe Windows 服务。如果 mongod.exe 正在运行,该操作将停止,然后删除该服务。
如果在--install操作期间配置了非默认的--serviceName,则--remove要求--serviceName。
--reinstall
``- 删除 mongod.exe 并重新安装 mongod.exe 作为 Windows 服务。
--serviceName
name
- 默认:MongoDB
设置为 Windows 服务运行时的服务名称 mongod.exe 。将此名称与net start <name>
和net stop <name>
操作一起使用。
您必须将--serviceName与--install或--remove选项结合使用。
--serviceDisplayName
<name>
- 默认:MongoDB
设置在 ServicesManagement 应用程序上为 MongoDB 列出的名称。
--serviceDescription
<description>
- 默认:MongoDB 服务器
设置 mongod.exe 服务描述。
您必须结合使用--serviceDescription和--install选项。
对于包含空格的描述,必须将描述用引号引起来。
--serviceUser
<user>
- 在特定用户的上下文中运行 mongod.exe 服务。该用户必须具有“作为服务登录”特权。
您必须结合使用--serviceUser和--install选项。
--servicePassword
<password>
- 使用--serviceUser选项运行时,为 mongod.exe 设置
<user>
的密码。
- 使用--serviceUser选项运行时,为 mongod.exe 设置
您必须结合使用--servicePassword和--install选项。