Hi All,
I have three servers running mongo in a replication. All works here.
I have 1 app server running Node & Mongoose
My Mongoose connection string looks like this.
mongoose.connect('mongodb://myVM1/test,myVM2:27018/test,myVM3:27019/test');
The point of this is if a Mongodb Primary goes does the Mongoose driver will look at it's seed list and find the primary and continue operation.
Problem
What I have found is this that this only works if the Primary server actually is shut off, just killing the (Primary) mongod process forces the remaining two servers to re-elect primary yes, but the mongoose connection now throws an error. connection error: [Error: no primary server found in set]
What can I do to the connection string to make this work better?
Thanks!
Flex