<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<div class="moz-cite-prefix">On 24.08.2022 11:56, Sasmita Panda
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CALf-Q451LEUPzn+4vONjLxvy6OP149Rf11F+i3fkVD4BVXzQ-w@mail.gmail.com">
<div><br>
</div>
<div>Now my primary cluster goes down so my secondary cluster
becomes primary . I have updated the connection string
against the domain in route53 . Now </div>
<div><b><a href="http://primary-cluster.xzy.com"
moz-do-not-send="true">primary-cluster.xzy.com</a></b> is
pointed to the new primary custer connection string . </div>
<div><br>
</div>
<div>While creating a connection from the console through the
mongo shell it's getting connected . But opensips is not able to
switch the connecting string somehow . still it's trying to
connect to the previous primary connection string . </div>
<div><br>
</div>
<div>It seems like opensips has cached the connection string and
is trying to connect to the same even after I have updated the
string from the backend . </div>
</blockquote>
<p><font face="monospace">libmongo will try each node in your CSV of
nodes, there is no going around this. Now, while your usage of
two completely different clusters in the same connection string
seems to be <b>non-conventional</b> (I don't recall any
documentation advising this, all Mongo docs talk about
connecting to either a <b>replica set</b>, or to a <b>list of</b>
<b>mongos</b> servers), I still think it could work. Maybe just
configure the "connectionTimeousMS" parameters (or others??) and
see if you can get libmongoc to time out faster on your 1st
cluster, when it goes down.</font></p>
<p><font face="monospace">Best regards,</font><br>
</p>
<pre class="moz-signature" cols="72">--
Liviu Chircu
<a class="moz-txt-link-abbreviated" href="http://www.twitter.com/liviuchircu">www.twitter.com/liviuchircu</a> | <a class="moz-txt-link-abbreviated" href="http://www.opensips-solutions.com">www.opensips-solutions.com</a>
OpenSIPS Summit 2022 Athens, Sep 27-30 | <a class="moz-txt-link-abbreviated" href="http://www.opensips.org/events">www.opensips.org/events</a></pre>
</body>
</html>