-
Type: Task
-
Resolution: Duplicate
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Options & Configuration
-
None
I am using Consul for service discovery with a MongoDB replica set. In Consul, I have an address for a primary node (e.g. mongo-primary.service.consul). To connect, I use the following connection string:
mongodb://<user>:<password>@mongo-primary.service.consul:27017/feed?replicaSet=rs&connect=direct
1.) Is this a safe way to connect to my replica set? Does the Go driver cache DNS connections? Is there a way for me to configure the cache TTL?
2.) Is there a way for me to connect this way without the option connect=direct? Is that expected when connecting directly to the primary?
- duplicates
-
DRIVERS-521 Allow custom service names with srvServiceName URI option
- Implementing