Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-2334

mongos and load balancer settings

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Critical - P2 Critical - P2
    • 01112017-cleanup
    • Affects Version/s: None
    • Component/s: manual
    • Labels:
      None

      Some users want to connect to mongoses via a load balancer, e.g. to scale out mongoses while using a single connection string, or as a network-security layer. We sort of suggest this when we say "You may also may deploy a group of mongos instances and use a proxy/load balancer between the application and the mongos.".

      In such a case the load balancer must be configured for "client affinity": every connection from a given client IP must be routed to the same mongos as other connections from that client. Mere "socket affinity" where connections from one client can be routed to several mongoses won't work. The main problem is that OP_GETMORE messages may go to a different mongos than the initial query, [as Craig Wilson pointed out|craiggwilson.com/2013/10/21/load-balanced-mongos/].

      An additional problem is when upgrading mongoses from one wire-protocol version to the next: the driver may call ismaster on one mongos and get protocol version X, then try to talk to a different mongos which only speaks wire-protocol version Y. This is avoided if all the connections from any single client use the same mongos.

      So let's make a page on load balancers with more detailed recommendations, emphasizing client affinity.

            Assignee:
            sam.kleinman Sam Kleinman (Inactive)
            Reporter:
            jesse@mongodb.com A. Jesse Jiryu Davis
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:
              10 years, 21 weeks, 4 days ago