MongoDB Replicaset Primary failure -


i exploring mongodb replica-sets , know how handle fail-over application.

following scenario:

lets assume have replica-set 3 nodes, a(primary), b(secondary) , c(secondary).

1.from application, host should connect to? a?

2.what happen when host fails? 1 secondary (say b) take on primary. should application designed handle transition , connect b now?

thanks in advance. have been confused on how design application while maintaining high availability replica-sets.

your application connect string can list addresses (or of them). mongodb driver knows 1 connect. need connect 1 of working nodes (even secondary) , application get's automatically addresses , knows 1 connect. works when primary transferred other node, application gets information address of new primary.


Comments

Popular posts from this blog

asynchronous - C# WinSCP .NET assembly: How to upload multiple files asynchronously -

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -