[DOCS-4890] Warn against non-canonical replica set member seeds Created: 28/Feb/15  Updated: 11/Jan/17  Resolved: 27/Jul/16

Status: Closed
Project: Documentation
Component/s: manual
Affects Version/s: None
Fix Version/s: 01112017-cleanup

Type: Improvement Priority: Major - P3
Reporter: A. Jesse Jiryu Davis Assignee: Unassigned
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to PHPC-105 Connections to non-canonical seed lis... Closed
related to DOCS-4886 To make initial discovery efficient, ... Closed
related to DOCS-4992 Clarify that the hostname(s) in a Con... Closed
Participants:
Days since reply: 8 years, 50 weeks, 4 days ago

 Description   

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.


Generated at Thu Feb 08 07:49:06 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.