In my scenario i expect the MongoClient (Meteor app) to connect to MongoDB secondary replica set when Primary Mongo is down. I have a 5 Cluster set up where when 3 MongoDB's are down the remaining 2 will be up as secondary and during this time the MongoClient should continue to establish connection with the secondary Mongo's and operate in a read only mode.
Has anyone tried this ?
I get various time outs
Cluster created with settings {hosts=[10.1.1.10:4000], mode=MULTIPLE, requiredClusterType=REPLICA_SET, serverSelectionTimeout='5 ms', maxWaitQueueSize=2000, requiredReplicaSetName='rs0'}
INFO | 2020-08-19 08:29:02,880 | 10.2.2.11 | org.mongodb.driver.cluster | Adding discovered server 10.1.1.10:4000 to client view of cluster
INFO | 2020-08-19 08:29:02,999 | 10.2.2.11 | org.mongodb.morphia.logging.MorphiaLoggerFactory | LoggerImplFactory set to org.mongodb.morphia.logging.jdk.JDKLoggerFactory
INFO | 2020-08-19 08:29:03,036 | 10.2.2.11 | org.mongodb.driver.cluster | Exception in monitor thread while connecting to server 10.1.1.10:4000
No server chosen by ReadPreferenceServerSelector{readPreference=primaryPreferred} from cluster description ClusterDescription{type=REPLICA_SET, connectionMode=MULTIPLE, serverDescriptions=[ServerDescription{address=10.1.1.10:4000, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketOpenException: Exception opening socket}, caused by {java.net.SocketTimeoutException: connect timed out}}]}. Waiting for 5 ms before timing out
Has anyone seen this error ?
This is how meteor connects to mongod
mongodb://username:password@host-01:4000,host-02:4000,host-03:4000,host-04:4000,host-05:4000/mydb?replicaSet=rs0
readPreference is PrimaryPreferred