You can set up your environment for restricting the primary server to not come back up until it get synchronized.<br>Krunal, could you explain your needs a little bit more? What kind of links do you have between boxes?<br>
Why are you thinking in a fail over solution?<br>Feel free to contact me in pvt, this may become boring for the list.<br>Note that cluster and fail over are not the same.<br><br>Pablo<br><br><div class="gmail_quote">On Tue, Nov 25, 2008 at 1:11 PM, Brett Nemeroff <span dir="ltr">&lt;<a href="mailto:brett@nemeroff.com">brett@nemeroff.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">You&#39;re going to have all sorts of data concurency problems doing any of this. Think about what happens as you get failures on one box and you start using the other.. The data will change on one and not the other.. then the primary comes back up.<div>

<br></div><div>You really need a DB failover solution and clustering is really the right way to do it.. I did this with MySQL Master/Slave replication for years. Although it works, there are still problems using the backup mysql server. Namely, you can&#39;t really be entirely sure it&#39;s accurate data. And then when the primary comes back online, you&#39;ll have CDR in the backup that isn&#39;t in the primary. All sorts of problems like that..</div>

<div><br></div><div>Now if you are just doing something simple like LCR routes, or simple lookups that are static, consider using something like dbtext instead as it doesn&#39;t need a mysql running process to operate.</div>

<div><br></div><div>That&#39;s my $0.02. I&#39;m sure there are others that used the master/slave type replication with success, but I think it&#39;s less than ideal. Just remember, it will look like a *perfect* solution for you, until you get a DB failure.</div>

<div>-Brett</div><div><div></div><div class="Wj3C7c"><div><br></div><div><br><div class="gmail_quote">On Tue, Nov 25, 2008 at 8:20 AM, Matteo D&#39;Amato <span dir="ltr">&lt;<a href="mailto:matteo@ecosma.com" target="_blank">matteo@ecosma.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">









<div link="blue" vlink="purple" lang="EN-US">

<div>

<p><span style="font-size: 11pt; color: rgb(31, 73, 125);">With SRV, if one box is down will it still get hit or does the
DNS only send to the one that is up?</span></p>

<p><span style="font-size: 11pt; color: rgb(31, 73, 125);">&nbsp;</span></p>

<p><span style="font-size: 11pt; color: rgb(31, 73, 125);">&nbsp;</span></p>

<div style="border-style: solid none none; border-color: rgb(181, 196, 223) -moz-use-text-color -moz-use-text-color; border-width: 1pt medium medium; padding: 3pt 0in 0in;">

<p><b><span style="font-size: 10pt;">From:</span></b><span style="font-size: 10pt;">
<a href="mailto:users-bounces@lists.opensips.org" target="_blank">users-bounces@lists.opensips.org</a> [mailto:<a href="mailto:users-bounces@lists.opensips.org" target="_blank">users-bounces@lists.opensips.org</a>] <b>On
Behalf Of </b>Pablo Hernan Saro<br>
<b>Sent:</b> Tuesday, November 25, 2008 8:04 AM<br>
<b>To:</b> Krunal Patel<br>
<b>Cc:</b> <a href="mailto:users@lists.opensips.org" target="_blank">users@lists.opensips.org</a><br>
<b>Subject:</b> Re: [OpenSIPS-Users] Help!! How to do failover of mysql
connection</span></p>

</div><div><div></div><div>

<p>&nbsp;</p>

<p style="margin-bottom: 12pt;">That will not work. Try DNS
SRV. Take a look at this link <a href="http://www.zytrax.com/books/dns/ch8/srv.html" target="_blank">http://www.zytrax.com/books/dns/ch8/srv.html</a><br>
Hope it helps.<br>
<br>
Pablo</p>

<div>

<p>On Tue, Nov 25, 2008 at 2:51 AM, Krunal Patel &lt;<a href="mailto:krunal.lists@gmail.com" target="_blank">krunal.lists@gmail.com</a>&gt; wrote:</p>

<p>Hi,<br>
<br>
is it fine if I use DSN resolver?<br>
Let me explain in detail:<br>
I setup a DSN resolver &amp; add A record for mysql servers.<br>
mysql&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
A&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="http://192.168.1.5" target="_blank">192.168.1.5</a><br>
mysql&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
A&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="http://192.168.1.6" target="_blank">192.168.1.6</a><br>
<br>
where <a href="http://192.168.1.5" target="_blank">192.168.1.5</a> &amp; <a href="http://192.168.1.6" target="_blank">192.168.1.6</a> are mysql cluster
nodes.<br>
<br>
So <a href="http://mysql.somedomain.com" target="_blank">mysql.somedomain.com</a>
will point to both servers.<br>
It will do load balance &amp; failover both.<br>
<br>
Please confirm that it will not create any issue.<br>
<br>
Thanks,<br>
<span style="color: rgb(136, 136, 136);">Krunal Patel</span></p>

<div>

<div>

<p style="margin-bottom: 12pt;">&nbsp;</p>

<div>

<p>On Tue, Nov 25, 2008 at 1:35 AM, Geoffrey Mina &lt;<a href="mailto:geoffreymina@gmail.com" target="_blank">geoffreymina@gmail.com</a>&gt;
wrote:</p>

<p>This problem has been solved many times. &nbsp;The absolute
most bomb-proof<br>
MySQL failover solution involves a combination of DRBD &nbsp;and Linux HA<br>
(Heart Beat). &nbsp;The replication model has too many issues IMO.</p>

<div>

<div>

<p><br>
<br>
<br>
<br>
On Sun, Nov 23, 2008 at 9:10 AM, Uwe Kastens &lt;<a href="mailto:kiste@kiste.org" target="_blank">kiste@kiste.org</a>&gt; wrote:<br>
&gt; Hi Krunal,<br>
&gt;&gt; &nbsp; &nbsp; * I am having 2 MySql servers. Lets say <a href="http://192.168.1.5" target="_blank">192.168.1.5</a><br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &lt;<a href="http://192.168.1.5" target="_blank">http://192.168.1.5</a>&gt;
&amp; <a href="http://192.168.1.6" target="_blank">192.168.1.6</a> &lt;<a href="http://192.168.1.6" target="_blank">http://192.168.1.6</a>&gt;<br>
&gt;&gt; &nbsp; &nbsp; * Opensips is at <a href="http://192.168.1.4" target="_blank">192.168.1.4</a> &lt;<a href="http://192.168.1.4" target="_blank">http://192.168.1.4</a>&gt;.<br>
&gt;&gt; &nbsp; &nbsp; * I would like to use <a href="http://192.168.1.6" target="_blank">192.168.1.6</a> &lt;<a href="http://192.168.1.6" target="_blank">http://192.168.1.6</a>&gt;
mysql server<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; for failover.<br>
&gt;&gt; &nbsp; &nbsp; * I mean to say if <a href="http://192.168.1.5" target="_blank">192.168.1.5</a> &lt;<a href="http://192.168.1.5" target="_blank">http://192.168.1.5</a>&gt;
goes down then<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; opensips should start to use <a href="http://192.168.1.6" target="_blank">192.168.1.6</a> &lt;<a href="http://192.168.1.6" target="_blank">http://192.168.1.6</a>&gt;<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; mysql server.<br>
&gt;&gt;<br>
&gt;<br>
&gt; I am just on my way to implement the same. At the moment I am planing a<br>
&gt; kind of Mysql Master - Master together with one VIP for<br>
&gt; Mysql-opensips-communication. So for your example you will have to<br>
&gt; mysql-servers. opensips is connection to lets say to <a href="http://192.168.1.4" target="_blank">192.168.1.4</a> which<br>
&gt; points on one of your mysql-servers. You will need active-active for<br>
&gt; mysql since opensips will write some information in the database as well.<br>
&gt;<br>
&gt;<br>
&gt; I am working with mysql-5 and heartbeat-2 in mode 1. Its nearly working.<br>
&gt;<br>
&gt; BR<br>
&gt;<br>
&gt; Kiste<br>
&gt;<br>
&gt; --<br>
&gt;<br>
&gt; kiste lat: 54.322684, lon: 10.13586<br>
&gt;</p>

</div>

</div>

<div>

<div>

<p>&gt; _______________________________________________<br>
&gt; Users mailing list<br>
&gt; <a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a><br>
&gt; <a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
&gt;<br>
<br>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a><br>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a></p>

</div>

</div>

</div>

<p>&nbsp;</p>

</div>

</div>

<p style="margin-bottom: 12pt;"><br>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a><br>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a></p>

</div>

<p>&nbsp;</p>

</div></div></div>

</div>


<br>_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a><br>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
<br></blockquote></div><br></div>
</div></div><br>_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a><br>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
<br></blockquote></div><br>