【问题标题】:How to configure multi mongos instances access to a sharded cluster?如何配置多个 mongos 实例访问分片集群?
【发布时间】:2020-06-04 18:53:04
【问题描述】:

我找不到任何明确的文档来解释如何在具有多个分片的单个分片集群中配置多个 mongos 实例。我想要更多的 mongos 并将它们分配给多个应用程序服务器以减少延迟。

【问题讨论】:

    标签: mongodb sharding mongo-shell


    【解决方案1】:

    您通过mongos 路由器从客户端访问分片集群。

    您的集群配置可以有许多mongos 路由器(请参阅Number of mongos and Distribution)。您从指定多个 mongos 的客户端(例如 mongo shell)连接 - 客户端使用 mongos 之一连接到集群 (见:Connecting to a Sharded Cluster)。

    mongo shell 客户端,您使用 连接字符串 连接到 MongoDB 服务器。要连接到分片集群,请使用 Standard ConnectionString Format 在连接字符串中指定 mongos 主机;一个example

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-04-03
      • 2019-02-06
      • 1970-01-01
      • 2017-08-11
      • 2014-10-02
      • 1970-01-01
      相关资源
      最近更新 更多