Details
-
Bug
-
Resolution: Works as Designed
-
Major - P3
-
None
-
None
-
None
-
None
Description
Apologies if this isn't the right place to file this!
I'm running my client code (which uses the Go MongoDB driver) on Kubernetes, along with 3 hosts running MongoDB (in a replica set). The client is configured to connect to "mongodb://mongo-0.mongo,mongo-1.mongo,mongo-2.mongo:27017". This works.
However, I have just noticed that if all Mongo replicas restart (and are given new IP addresses by Kubernetes), the client code doesn't seem to pick up this change; trying to run Mongo queries fails with 'connection reset by peer' errors which indicate that the client was trying to communicate with the old IP addresses.
I'm not sure what I should be doing here to handle this. Have we misconfigured some monitor setup, or do we need to configure some DNS resolution refresh frequency option? Should we be using "mongodb+srv" connection strings? I'm a little lost.