Uploaded image for project: 'Go Driver'
  1. Go Driver
  2. GODRIVER-777

Does the Go Driver cache DNS and if so how long?

    • Type: Icon: Task Task
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • 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?

            Assignee:
            david.golden@mongodb.com David Golden
            Reporter:
            wesp Wesley Porter
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: