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

Warn against non-canonical replica set member seeds

    • Type: Icon: Task Task
    • Resolution: Won't Fix
    • Priority: Icon: Major - P3 Major - P3
    • 01112017-cleanup
    • Affects Version/s: None
    • Component/s: manual
    • Labels:
      None

      The warning here:

      http://php.net/manual/en/mongo.connecting.rs.php

      The host names that you specify in the seed list must match the host names in the replica set configuration. This is because the driver only uses the host names in the replica set configuration to create the hash for its persistent connections.

      For example, if an IP address is used in the seed list and the replica set is configured with host names, the driver will discard any seed list connection(s) that differ from the canonical host names reported by the replica set. Effectively, these non-canonical seed list connections will be recreated on each request, greatly reducing the benefit of using persistent connections.

      Applies, more or less, to all drivers. A driver must connect to a replica set using the exact same hostnames as the replica set itself uses in its config. So if you have an RS member that listens on "private.com" and "public.com", and the hostname "private.com" is in the RS config but you connect to "mongodb://public.com/?replicaSet=rs", various surprising and inefficient things will happen.

      When I did trainings, we emphasized this to customers, as the main mistake to avoid when configuring and connecting to an RS. But I can't find this warning in the manual now.

            Assignee:
            Unassigned Unassigned
            Reporter:
            jesse@mongodb.com A. Jesse Jiryu Davis
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              9 years, 11 weeks, 3 days ago