mongos.exe

在本页面

Synopsis

mongos.exe是 Windows 平台的 MongoDB Shard(即mongos)的构建。 mongos.exe在类 Unix 平台上具有mongos的所有功能,并且与mongos的其他内部版本完全兼容。此外,mongos.exe提供了几个与 Windows 平台本身进行交互的选项。

本文档仅引用mongos.exe独有的选项。所有mongos选项均可用。有关mongos.exe的更多信息,请参见mongos配置文件选项文档。

要安装和使用mongos.exe,请阅读在 Windows 上安装 MongoDB 社区版文档。

Options

  • mongos. exe

  • --install ``

    • mongos.exe 作为 Windows 服务安装并退出。

如果需要,您可以为 mongos.exe 的多个实例安装服务。使用唯一的--serviceName--serviceDisplayName安装每个服务。仅当存在足够的系统资源并且您的系统设计需要它时才使用多个实例。

  • --remove ``
    • 删除 mongos.exe Windows 服务。如果 mongos.exe 正在运行,则此操作将停止,然后删除该服务。

如果在--install操作期间配置了非默认的--serviceName,则--remove要求--serviceName

  • --reinstall ``

    • 删除 mongos.exe 并重新安装 mongos.exe 作为 Windows 服务。
  • --serviceName name

    • 默认:MongoS

设置作为 Windows 服务运行时的服务名称 mongos.exe 。将此名称与net start <name>net stop <name>操作一起使用。

您必须将--serviceName--install--remove选项结合使用。

  • --serviceDisplayName <name>
    • 默认:Mongo DBRouter

设置在 ServicesManagement 应用程序上为 MongoDB 列出的名称。

  • --serviceDescription <description>
    • 默认:Mongo DB 分片 Router

设置 mongos.exe 服务描述。

您必须结合使用--serviceDescription--install选项。

对于包含空格的描述,必须将描述用引号引起来。

  • --serviceUser <user>
    • 在特定用户的上下文中运行 mongos.exe 服务。该用户必须具有“作为服务登录”特权。

您必须结合使用--serviceUser--install选项。

  • --servicePassword <password>
    • 使用--serviceUser选项运行时,为 mongos.exe 设置<user>的密码。

您必须结合使用--servicePassword--install选项。