Help!! How to do failover of mysql connection

classic Classic list List threaded Threaded
22 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Help!! How to do failover of mysql connection

Krunal Patel-4
Hi,

Here is what I would like to implement:
Please let me know is it possible?
If it is possible then how to do it?

Thanks in advance!!

--
Krunal Patel


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Help!! How to do failover of mysql connection

Pablo Hernan Saro
Hi Krunal,

As far as I know, the db_mysql module does not support fail-over. But you can do it out OpenSIPS.
Search for MySQL proxy (it is what you need, but it stills alpha). Other possibility is to consider a MySQL cluster and a local replication in the same machine where OpenSIPS runs -with a secondary configuration file-, but you have to take care of switching to the local db.
Hope it helps.

Pablo

On Sat, Nov 22, 2008 at 3:37 AM, Krunal Patel <[hidden email]> wrote:
Hi,

Here is what I would like to implement:
Please let me know is it possible?
If it is possible then how to do it?

Thanks in advance!!

--
Krunal Patel


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users



_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Help!! How to do failover of mysql connection

Alex G-2
clustering is really the way to go. Replication has too many downfalls.

On Sat, Nov 22, 2008 at 11:40 AM, Pablo Hernan Saro <[hidden email]> wrote:
Hi Krunal,

As far as I know, the db_mysql module does not support fail-over. But you can do it out OpenSIPS.
Search for MySQL proxy (it is what you need, but it stills alpha). Other possibility is to consider a MySQL cluster and a local replication in the same machine where OpenSIPS runs -with a secondary configuration file-, but you have to take care of switching to the local db.
Hope it helps.

Pablo

On Sat, Nov 22, 2008 at 3:37 AM, Krunal Patel <[hidden email]> wrote:
Hi,

Here is what I would like to implement:
Please let me know is it possible?
If it is possible then how to do it?

Thanks in advance!!

--
Krunal Patel


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users



_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users



_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

ERROR: database engine not specified, please setup one in the config script

cesar.fiestas
In reply to this post by Krunal Patel-4
Hello

I am trying to install opensips 1.4.2 and when i am entering the opensipsdbctl create command I get the following error below, i have check the configuration "opensipsdbctl" and everything seems correct i have re-install twice opensips as well debian and I keep getting the same error.

localhost:/usr/src/opensips-1.4.2-tls# opensipsdbctl create
ERROR: database engine not specified, please setup one in the config script
localhost:/usr/src/opensips-1.4.2-tls#


I will appreciate any help, thanks

Krunal Patel wrote
Hi,

Here is what I would like to implement:

   - I am having 2 MySql servers. Lets say 192.168.1.5 & 192.168.1.6
   - Opensips is at 192.168.1.4.
   - I would like to use 192.168.1.6 mysql server for failover.
   - I mean to say if 192.168.1.5 goes down then opensips should start to
   use 192.168.1.6 mysql server.

Please let me know is it possible?
If it is possible then how to do it?

Thanks in advance!!

--
Krunal Patel

_______________________________________________
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Help!! How to do failover of mysql connection

Uwe Kastens
In reply to this post by Krunal Patel-4
Hi Krunal,
>     * I am having 2 MySql servers. Lets say 192.168.1.5
>       <http://192.168.1.5> & 192.168.1.6 <http://192.168.1.6>
>     * Opensips is at 192.168.1.4 <http://192.168.1.4>.
>     * I would like to use 192.168.1.6 <http://192.168.1.6> mysql server
>       for failover.
>     * I mean to say if 192.168.1.5 <http://192.168.1.5> goes down then
>       opensips should start to use 192.168.1.6 <http://192.168.1.6>
>       mysql server.
>

I am just on my way to implement the same. At the moment I am planing a
kind of Mysql Master - Master together with one VIP for
Mysql-opensips-communication. So for your example you will have to
mysql-servers. opensips is connection to lets say to 192.168.1.4 which
points on one of your mysql-servers. You will need active-active for
mysql since opensips will write some information in the database as well.


I am working with mysql-5 and heartbeat-2 in mode 1. Its nearly working.

BR

Kiste

--

kiste lat: 54.322684, lon: 10.13586

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Help!! How to do failover of mysql connection

Geoffrey Mina
This problem has been solved many times.  The absolute most bomb-proof
MySQL failover solution involves a combination of DRBD  and Linux HA
(Heart Beat).  The replication model has too many issues IMO.




On Sun, Nov 23, 2008 at 9:10 AM, Uwe Kastens <[hidden email]> wrote:

> Hi Krunal,
>>     * I am having 2 MySql servers. Lets say 192.168.1.5
>>       <http://192.168.1.5> & 192.168.1.6 <http://192.168.1.6>
>>     * Opensips is at 192.168.1.4 <http://192.168.1.4>.
>>     * I would like to use 192.168.1.6 <http://192.168.1.6> mysql server
>>       for failover.
>>     * I mean to say if 192.168.1.5 <http://192.168.1.5> goes down then
>>       opensips should start to use 192.168.1.6 <http://192.168.1.6>
>>       mysql server.
>>
>
> I am just on my way to implement the same. At the moment I am planing a
> kind of Mysql Master - Master together with one VIP for
> Mysql-opensips-communication. So for your example you will have to
> mysql-servers. opensips is connection to lets say to 192.168.1.4 which
> points on one of your mysql-servers. You will need active-active for
> mysql since opensips will write some information in the database as well.
>
>
> I am working with mysql-5 and heartbeat-2 in mode 1. Its nearly working.
>
> BR
>
> Kiste
>
> --
>
> kiste lat: 54.322684, lon: 10.13586
>
> _______________________________________________
> Users mailing list
> [hidden email]
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Help!! How to do failover of mysql connection

Krunal Patel-4
Hi,

is it fine if I use DSN resolver?
Let me explain in detail:
I setup a DSN resolver & add A record for mysql servers.
mysql         A          192.168.1.5
mysql         A          192.168.1.6

where 192.168.1.5 & 192.168.1.6 are mysql cluster nodes.

So mysql.somedomain.com will point to both servers.
It will do load balance & failover both.

Please confirm that it will not create any issue.

Thanks,
Krunal Patel

On Tue, Nov 25, 2008 at 1:35 AM, Geoffrey Mina <[hidden email]> wrote:
This problem has been solved many times.  The absolute most bomb-proof
MySQL failover solution involves a combination of DRBD  and Linux HA
(Heart Beat).  The replication model has too many issues IMO.




On Sun, Nov 23, 2008 at 9:10 AM, Uwe Kastens <[hidden email]> wrote:
> Hi Krunal,
>>     * I am having 2 MySql servers. Lets say 192.168.1.5
>>       <http://192.168.1.5> & 192.168.1.6 <http://192.168.1.6>
>>     * Opensips is at 192.168.1.4 <http://192.168.1.4>.
>>     * I would like to use 192.168.1.6 <http://192.168.1.6> mysql server
>>       for failover.
>>     * I mean to say if 192.168.1.5 <http://192.168.1.5> goes down then
>>       opensips should start to use 192.168.1.6 <http://192.168.1.6>
>>       mysql server.
>>
>
> I am just on my way to implement the same. At the moment I am planing a
> kind of Mysql Master - Master together with one VIP for
> Mysql-opensips-communication. So for your example you will have to
> mysql-servers. opensips is connection to lets say to 192.168.1.4 which
> points on one of your mysql-servers. You will need active-active for
> mysql since opensips will write some information in the database as well.
>
>
> I am working with mysql-5 and heartbeat-2 in mode 1. Its nearly working.
>
> BR
>
> Kiste
>
> --
>
> kiste lat: 54.322684, lon: 10.13586
>
> _______________________________________________
> Users mailing list
> [hidden email]
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Help!! How to do failover of mysql connection

Pablo Hernan Saro
That will not work. Try DNS SRV. Take a look at this link http://www.zytrax.com/books/dns/ch8/srv.html
Hope it helps.

Pablo

On Tue, Nov 25, 2008 at 2:51 AM, Krunal Patel <[hidden email]> wrote:
Hi,

is it fine if I use DSN resolver?
Let me explain in detail:
I setup a DSN resolver & add A record for mysql servers.
mysql         A          192.168.1.5
mysql         A          192.168.1.6

where 192.168.1.5 & 192.168.1.6 are mysql cluster nodes.

So mysql.somedomain.com will point to both servers.
It will do load balance & failover both.

Please confirm that it will not create any issue.

Thanks,
Krunal Patel


On Tue, Nov 25, 2008 at 1:35 AM, Geoffrey Mina <[hidden email]> wrote:
This problem has been solved many times.  The absolute most bomb-proof
MySQL failover solution involves a combination of DRBD  and Linux HA
(Heart Beat).  The replication model has too many issues IMO.




On Sun, Nov 23, 2008 at 9:10 AM, Uwe Kastens <[hidden email]> wrote:
> Hi Krunal,
>>     * I am having 2 MySql servers. Lets say 192.168.1.5
>>       <http://192.168.1.5> & 192.168.1.6 <http://192.168.1.6>
>>     * Opensips is at 192.168.1.4 <http://192.168.1.4>.
>>     * I would like to use 192.168.1.6 <http://192.168.1.6> mysql server
>>       for failover.
>>     * I mean to say if 192.168.1.5 <http://192.168.1.5> goes down then
>>       opensips should start to use 192.168.1.6 <http://192.168.1.6>
>>       mysql server.
>>
>
> I am just on my way to implement the same. At the moment I am planing a
> kind of Mysql Master - Master together with one VIP for
> Mysql-opensips-communication. So for your example you will have to
> mysql-servers. opensips is connection to lets say to 192.168.1.4 which
> points on one of your mysql-servers. You will need active-active for
> mysql since opensips will write some information in the database as well.
>
>
> I am working with mysql-5 and heartbeat-2 in mode 1. Its nearly working.
>
> BR
>
> Kiste
>
> --
>
> kiste lat: 54.322684, lon: 10.13586
>
> _______________________________________________
> Users mailing list
> [hidden email]
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users



_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Help!! How to do failover of mysql connection

Matteo D'Amato

With SRV, if one box is down will it still get hit or does the DNS only send to the one that is up?

 

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Pablo Hernan Saro
Sent: Tuesday, November 25, 2008 8:04 AM
To: Krunal Patel
Cc: [hidden email]
Subject: Re: [OpenSIPS-Users] Help!! How to do failover of mysql connection

 

That will not work. Try DNS SRV. Take a look at this link http://www.zytrax.com/books/dns/ch8/srv.html
Hope it helps.

Pablo

On Tue, Nov 25, 2008 at 2:51 AM, Krunal Patel <[hidden email]> wrote:

Hi,

is it fine if I use DSN resolver?
Let me explain in detail:
I setup a DSN resolver & add A record for mysql servers.
mysql         A          192.168.1.5
mysql         A          192.168.1.6

where 192.168.1.5 & 192.168.1.6 are mysql cluster nodes.

So mysql.somedomain.com will point to both servers.
It will do load balance & failover both.

Please confirm that it will not create any issue.

Thanks,
Krunal Patel

 

On Tue, Nov 25, 2008 at 1:35 AM, Geoffrey Mina <[hidden email]> wrote:

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





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

> _______________________________________________
> Users mailing list
> [hidden email]
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users

 


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users

 


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Help!! How to do failover of mysql connection

Pablo Hernan Saro
"The theory behind SRV is that given a domain name, for instance, example.com, and a service name, for example, web (http) which runs on a protocol (tcp in the web case case), a DNS query may be issued to find the host name that provides such a service for the domain" -from http://www.zytrax.com/books/dns/ch8/srv.html

So, what you will get is a list of host names that provide the service you're looking for. Then, you have to try those hosts until you get a response.
What I've just realized is that db_mysql module may not support this...

Pablo

On Tue, Nov 25, 2008 at 12:20 PM, Matteo D'Amato <[hidden email]> wrote:

With SRV, if one box is down will it still get hit or does the DNS only send to the one that is up?

 

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Pablo Hernan Saro
Sent: Tuesday, November 25, 2008 8:04 AM
To: Krunal Patel
Cc: [hidden email]
Subject: Re: [OpenSIPS-Users] Help!! How to do failover of mysql connection

 

That will not work. Try DNS SRV. Take a look at this link http://www.zytrax.com/books/dns/ch8/srv.html
Hope it helps.

Pablo

On Tue, Nov 25, 2008 at 2:51 AM, Krunal Patel <[hidden email]> wrote:

Hi,

is it fine if I use DSN resolver?
Let me explain in detail:
I setup a DSN resolver & add A record for mysql servers.
mysql         A          192.168.1.5
mysql         A          192.168.1.6

where 192.168.1.5 & 192.168.1.6 are mysql cluster nodes.

So mysql.somedomain.com will point to both servers.
It will do load balance & failover both.

Please confirm that it will not create any issue.

Thanks,
Krunal Patel

 

On Tue, Nov 25, 2008 at 1:35 AM, Geoffrey Mina <[hidden email]> wrote:

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





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

> _______________________________________________
> Users mailing list
> [hidden email]
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users

 


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users

 


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users



_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Help!! How to do failover of mysql connection

Brett Nemeroff
In reply to this post by Matteo D'Amato
You'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.

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't really be entirely sure it's accurate data. And then when the primary comes back online, you'll have CDR in the backup that isn't in the primary. All sorts of problems like that..

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't need a mysql running process to operate.

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


On Tue, Nov 25, 2008 at 8:20 AM, Matteo D'Amato <[hidden email]> wrote:

With SRV, if one box is down will it still get hit or does the DNS only send to the one that is up?

 

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Pablo Hernan Saro
Sent: Tuesday, November 25, 2008 8:04 AM
To: Krunal Patel
Cc: [hidden email]
Subject: Re: [OpenSIPS-Users] Help!! How to do failover of mysql connection

 

That will not work. Try DNS SRV. Take a look at this link http://www.zytrax.com/books/dns/ch8/srv.html
Hope it helps.

Pablo

On Tue, Nov 25, 2008 at 2:51 AM, Krunal Patel <[hidden email]> wrote:

Hi,

is it fine if I use DSN resolver?
Let me explain in detail:
I setup a DSN resolver & add A record for mysql servers.
mysql         A          192.168.1.5
mysql         A          192.168.1.6

where 192.168.1.5 & 192.168.1.6 are mysql cluster nodes.

So mysql.somedomain.com will point to both servers.
It will do load balance & failover both.

Please confirm that it will not create any issue.

Thanks,
Krunal Patel

 

On Tue, Nov 25, 2008 at 1:35 AM, Geoffrey Mina <[hidden email]> wrote:

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





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

> _______________________________________________
> Users mailing list
> [hidden email]
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users

 


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users

 


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users



_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Help!! How to do failover of mysql connection

Pablo Hernan Saro
You can set up your environment for restricting the primary server to not come back up until it get synchronized.
Krunal, could you explain your needs a little bit more? What kind of links do you have between boxes?
Why are you thinking in a fail over solution?
Feel free to contact me in pvt, this may become boring for the list.
Note that cluster and fail over are not the same.

Pablo

On Tue, Nov 25, 2008 at 1:11 PM, Brett Nemeroff <[hidden email]> wrote:
You'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.

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't really be entirely sure it's accurate data. And then when the primary comes back online, you'll have CDR in the backup that isn't in the primary. All sorts of problems like that..

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't need a mysql running process to operate.

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


On Tue, Nov 25, 2008 at 8:20 AM, Matteo D'Amato <[hidden email]> wrote:

With SRV, if one box is down will it still get hit or does the DNS only send to the one that is up?

 

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Pablo Hernan Saro
Sent: Tuesday, November 25, 2008 8:04 AM
To: Krunal Patel
Cc: [hidden email]
Subject: Re: [OpenSIPS-Users] Help!! How to do failover of mysql connection

 

That will not work. Try DNS SRV. Take a look at this link http://www.zytrax.com/books/dns/ch8/srv.html
Hope it helps.

Pablo

On Tue, Nov 25, 2008 at 2:51 AM, Krunal Patel <[hidden email]> wrote:

Hi,

is it fine if I use DSN resolver?
Let me explain in detail:
I setup a DSN resolver & add A record for mysql servers.
mysql         A          192.168.1.5
mysql         A          192.168.1.6

where 192.168.1.5 & 192.168.1.6 are mysql cluster nodes.

So mysql.somedomain.com will point to both servers.
It will do load balance & failover both.

Please confirm that it will not create any issue.

Thanks,
Krunal Patel

 

On Tue, Nov 25, 2008 at 1:35 AM, Geoffrey Mina <[hidden email]> wrote:

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





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

> _______________________________________________
> Users mailing list
> [hidden email]
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users

 


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users

 


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users



_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users



_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Help!! How to do failover of mysql connection

Krunal Patel-4
In reply to this post by Uwe Kastens
Hi Kiste,

I am just on my way to implement the same. At the moment I am planing a
kind of Mysql Master - Master together with one VIP for
Mysql-opensips-communication. So for your example you will have to
mysql-servers. opensips is connection to lets say to 192.168.1.4 which
points on one of your mysql-servers. You will need active-active for
mysql since opensips will write some information in the database as well.
 
 I am working with mysql-5 and heartbeat-2 in mode 1. Its nearly working.

Would you please explain it somewhat in detail?

Thanks,
Krunal Patel

On Sun, Nov 23, 2008 at 7:40 PM, Uwe Kastens <[hidden email]> wrote:
Hi Krunal,
>     * I am having 2 MySql servers. Lets say 192.168.1.5
>       <http://192.168.1.5> & 192.168.1.6 <http://192.168.1.6>
>     * Opensips is at 192.168.1.4 <http://192.168.1.4>.
>     * I would like to use 192.168.1.6 <http://192.168.1.6> mysql server
>       for failover.
>     * I mean to say if 192.168.1.5 <http://192.168.1.5> goes down then
>       opensips should start to use 192.168.1.6 <http://192.168.1.6>
>       mysql server.
>

I am just on my way to implement the same. At the moment I am planing a
kind of Mysql Master - Master together with one VIP for
Mysql-opensips-communication. So for your example you will have to
mysql-servers. opensips is connection to lets say to 192.168.1.4 which
points on one of your mysql-servers. You will need active-active for
mysql since opensips will write some information in the database as well.


I am working with mysql-5 and heartbeat-2 in mode 1. Its nearly working.

BR

Kiste

--

kiste lat: 54.322684, lon: 10.13586


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Help!! How to do failover of mysql connection

Uwe Kastens
Hi Krunal,

>
>     I am just on my way to implement the same. At the moment I am planing a
>     kind of Mysql Master - Master together with one VIP for
>     Mysql-opensips-communication. So for your example you will have to
>     mysql-servers. opensips is connection to lets say to 192.168.1.4
>     <http://192.168.1.4/> which
>     points on one of your mysql-servers. You will need active-active for
>     mysql since opensips will write some information in the database as
>     well.
>
>      
>
>      I am working with mysql-5 and heartbeat-2 in mode 1. Its nearly
>     working.
>
>
> Would you please explain it somewhat in detail?

Sure, at the moment its only a testing platform. I took two
MySQL-Servers which are configured as master-master. So writing on both
databases is possible and is synchronized. I found a good step-by-step
guide under:

http://www.howtoforge.com/mysql_master_master_replication

I configured a very simple setup for heartbeat to share one VIP between
both servers for client connection. So a kind of mysql-test is needed to
check if the database is online on the "normal" IP-Adress. If not the
VIP should be switched to the other server. I found a kind of
nagios_mysql_check usefull.

The openser-servers are connecting only to the vip address. Read and
Write are working on only one database. This should be enough for a
small environment.

Why no master - slave? I found it to complicate to make a slave to a
master by skript.

Why not the "normal" setup (drbd with mysql and heartbeat)? I looks to
complicated.

But! I have no idea how it will work in a real world.

BR

kiste
--

kiste lat: 54.322684, lon: 10.13586

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Help!! How to do failover of mysql connection

Brett Nemeroff
Before doing this, I'd seriously consider the problems associated with master-master replication. 

um, I don't know what they are.. but I know they are real problems. Such as collisions in auto-incrementing data.
-Brett


On Wed, Nov 26, 2008 at 3:06 PM, Uwe Kastens <[hidden email]> wrote:
Hi Krunal,

>
>     I am just on my way to implement the same. At the moment I am planing a
>     kind of Mysql Master - Master together with one VIP for
>     Mysql-opensips-communication. So for your example you will have to
>     mysql-servers. opensips is connection to lets say to 192.168.1.4
>     <http://192.168.1.4/> which
>     points on one of your mysql-servers. You will need active-active for
>     mysql since opensips will write some information in the database as
>     well.
>
>
>
>      I am working with mysql-5 and heartbeat-2 in mode 1. Its nearly
>     working.
>
>
> Would you please explain it somewhat in detail?

Sure, at the moment its only a testing platform. I took two
MySQL-Servers which are configured as master-master. So writing on both
databases is possible and is synchronized. I found a good step-by-step
guide under:

http://www.howtoforge.com/mysql_master_master_replication

I configured a very simple setup for heartbeat to share one VIP between
both servers for client connection. So a kind of mysql-test is needed to
check if the database is online on the "normal" IP-Adress. If not the
VIP should be switched to the other server. I found a kind of
nagios_mysql_check usefull.

The openser-servers are connecting only to the vip address. Read and
Write are working on only one database. This should be enough for a
small environment.

Why no master - slave? I found it to complicate to make a slave to a
master by skript.

Why not the "normal" setup (drbd with mysql and heartbeat)? I looks to
complicated.

But! I have no idea how it will work in a real world.

BR

kiste
--

kiste lat: 54.322684, lon: 10.13586

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Help!! How to do failover of mysql connection

Adrian Georgescu
Try use this settings:

On master

auto_increment_increment = 2
auto_increment_offset = 0

On slave

auto_increment_increment = 2
auto_increment_offset = 1

This makes sure that auto-increments do not colide between master and slave so you can achieve switchover without conflicts because of auto increment columns. 

Adrian


On Nov 26, 2008, at 10:18 PM, Brett Nemeroff wrote:

Before doing this, I'd seriously consider the problems associated with master-master replication. 

um, I don't know what they are.. but I know they are real problems. Such as collisions in auto-incrementing data.
-Brett


On Wed, Nov 26, 2008 at 3:06 PM, Uwe Kastens <[hidden email]> wrote:
Hi Krunal,

>
>     I am just on my way to implement the same. At the moment I am planing a
>     kind of Mysql Master - Master together with one VIP for
>     Mysql-opensips-communication. So for your example you will have to
>     mysql-servers. opensips is connection to lets say to 192.168.1.4
>     <http://192.168.1.4/> which
>     points on one of your mysql-servers. You will need active-active for
>     mysql since opensips will write some information in the database as
>     well.
>
>
>
>      I am working with mysql-5 and heartbeat-2 in mode 1. Its nearly
>     working.
>
>
> Would you please explain it somewhat in detail?

Sure, at the moment its only a testing platform. I took two
MySQL-Servers which are configured as master-master. So writing on both
databases is possible and is synchronized. I found a good step-by-step
guide under:

http://www.howtoforge.com/mysql_master_master_replication

I configured a very simple setup for heartbeat to share one VIP between
both servers for client connection. So a kind of mysql-test is needed to
check if the database is online on the "normal" IP-Adress. If not the
VIP should be switched to the other server. I found a kind of
nagios_mysql_check usefull.

The openser-servers are connecting only to the vip address. Read and
Write are working on only one database. This should be enough for a
small environment.

Why no master - slave? I found it to complicate to make a slave to a
master by skript.

Why not the "normal" setup (drbd with mysql and heartbeat)? I looks to
complicated.

But! I have no idea how it will work in a real world.

BR

kiste
--

kiste lat: 54.322684, lon: 10.13586

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Help!! How to do failover of mysql connection

Uwe Kastens
In reply to this post by Brett Nemeroff
Hi,

As far as I know this problem is fixed in MySQL5 - but I am not sure
about ...

BR

Uwe

Brett Nemeroff schrieb:

> Before doing this, I'd seriously consider the problems associated with
> master-master replication.
>
> um, I don't know what they are.. but I know they are real problems. Such
> as collisions in auto-incrementing data.
> -Brett
>
>
> On Wed, Nov 26, 2008 at 3:06 PM, Uwe Kastens <[hidden email]
> <mailto:[hidden email]>> wrote:
>
>     Hi Krunal,
>
>     >
>     >     I am just on my way to implement the same. At the moment I am
>     planing a
>     >     kind of Mysql Master - Master together with one VIP for
>     >     Mysql-opensips-communication. So for your example you will have to
>     >     mysql-servers. opensips is connection to lets say to
>     192.168.1.4 <http://192.168.1.4>
>     >     <http://192.168.1.4/> which
>     >     points on one of your mysql-servers. You will need
>     active-active for
>     >     mysql since opensips will write some information in the
>     database as
>     >     well.
>     >
>     >
>     >
>     >      I am working with mysql-5 and heartbeat-2 in mode 1. Its nearly
>     >     working.
>     >
>     >
>     > Would you please explain it somewhat in detail?
>
>     Sure, at the moment its only a testing platform. I took two
>     MySQL-Servers which are configured as master-master. So writing on both
>     databases is possible and is synchronized. I found a good step-by-step
>     guide under:
>
>     http://www.howtoforge.com/mysql_master_master_replication
>
>     I configured a very simple setup for heartbeat to share one VIP between
>     both servers for client connection. So a kind of mysql-test is needed to
>     check if the database is online on the "normal" IP-Adress. If not the
>     VIP should be switched to the other server. I found a kind of
>     nagios_mysql_check usefull.
>
>     The openser-servers are connecting only to the vip address. Read and
>     Write are working on only one database. This should be enough for a
>     small environment.
>
>     Why no master - slave? I found it to complicate to make a slave to a
>     master by skript.
>
>     Why not the "normal" setup (drbd with mysql and heartbeat)? I looks to
>     complicated.
>
>     But! I have no idea how it will work in a real world.
>
>     BR
>
>     kiste
>     --
>
>     kiste lat: 54.322684, lon: 10.13586
>
>     _______________________________________________
>     Users mailing list
>     [hidden email] <mailto:[hidden email]>
>     http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>


--

kiste lat: 54.322684, lon: 10.13586

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Help!! How to do failover of mysql connection

Krunal Patel-4
Hi

Thanks for your help.
I have installed mysql-proxy.
I have tested it for failover.
It seems working.

Thanks again..
Krunal Patel




On Thu, Nov 27, 2008 at 1:33 PM, Uwe Kastens <[hidden email]> wrote:
Hi,

As far as I know this problem is fixed in MySQL5 - but I am not sure
about ...

BR

Uwe

Brett Nemeroff schrieb:
> Before doing this, I'd seriously consider the problems associated with
> master-master replication.
>
> um, I don't know what they are.. but I know they are real problems. Such
> as collisions in auto-incrementing data.
> -Brett
>
>
> On Wed, Nov 26, 2008 at 3:06 PM, Uwe Kastens <[hidden email]
> <mailto:[hidden email]>> wrote:
>
>     Hi Krunal,
>
>     >
>     >     I am just on my way to implement the same. At the moment I am
>     planing a
>     >     kind of Mysql Master - Master together with one VIP for
>     >     Mysql-opensips-communication. So for your example you will have to
>     >     mysql-servers. opensips is connection to lets say to
>     192.168.1.4 <http://192.168.1.4>
>     >     <http://192.168.1.4/> which
>     >     points on one of your mysql-servers. You will need
>     active-active for
>     >     mysql since opensips will write some information in the
>     database as
>     >     well.
>     >
>     >
>     >
>     >      I am working with mysql-5 and heartbeat-2 in mode 1. Its nearly
>     >     working.
>     >
>     >
>     > Would you please explain it somewhat in detail?
>
>     Sure, at the moment its only a testing platform. I took two
>     MySQL-Servers which are configured as master-master. So writing on both
>     databases is possible and is synchronized. I found a good step-by-step
>     guide under:
>
>     http://www.howtoforge.com/mysql_master_master_replication
>
>     I configured a very simple setup for heartbeat to share one VIP between
>     both servers for client connection. So a kind of mysql-test is needed to
>     check if the database is online on the "normal" IP-Adress. If not the
>     VIP should be switched to the other server. I found a kind of
>     nagios_mysql_check usefull.
>
>     The openser-servers are connecting only to the vip address. Read and
>     Write are working on only one database. This should be enough for a
>     small environment.
>
>     Why no master - slave? I found it to complicate to make a slave to a
>     master by skript.
>
>     Why not the "normal" setup (drbd with mysql and heartbeat)? I looks to
>     complicated.
>
>     But! I have no idea how it will work in a real world.
>
>     BR
>
>     kiste
>     --
>
>     kiste lat: 54.322684, lon: 10.13586
>
>     _______________________________________________
>     Users mailing list
>     [hidden email] <mailto:[hidden email]>
--

kiste lat: 54.322684, lon: 10.13586


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Help!! How to do failover of mysql connection

agung nugroho
Krunal Patel <krunal.lists@...> writes:

>
>
> HiThanks for your help.I have installed mysql-proxy.I have tested it for
> failover.It seems working.Thanks again..Krunal Patel


Hi krunal Patel,
I was read your post about failover of mysql. I still dont understand it.
Actually my need is to connect opensips with mysql that in other PC.
How can I do that?? I using opensips-1.6.1-notls.
My configuration is opensips on 10.14.11.1 and mysql server on 10.14.11.2
I have been try this setting:
modparam("usrloc", "db_url", "mysql://root:******@10.14.11.2/opensips")
or
modparam("usrloc", "db_url", "mysql://root:******@10.14.11.2:3306/opensips")
But I still get error :
ERROR:db_mysql:db_mysql_connect: driver error(2003): Can't connect to MySQL
server on '10.14.11.2' (111)

Is there any solution???

thanks before.


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Help!! How to do failover of mysql connection

Bogdan-Andrei Iancu
Hi,

are you sure the mysql server on 10.14.11.2 is configured to listen on a
network interface (and not only on local host) ? check on the
10.14.11.2  with "netstat -tlnp | grep mysqld" and see if mysql is
listed as TCP listener.

Regards,
Bogdan

agung nugroho wrote:

> Krunal Patel <krunal.lists@...> writes:
>
>  
>> HiThanks for your help.I have installed mysql-proxy.I have tested it for
>> failover.It seems working.Thanks again..Krunal Patel
>>    
>
>
> Hi krunal Patel,
> I was read your post about failover of mysql. I still dont understand it.
> Actually my need is to connect opensips with mysql that in other PC.
> How can I do that?? I using opensips-1.6.1-notls.
> My configuration is opensips on 10.14.11.1 and mysql server on 10.14.11.2
> I have been try this setting:
> modparam("usrloc", "db_url", "mysql://root:******@10.14.11.2/opensips")
> or
> modparam("usrloc", "db_url", "mysql://root:******@10.14.11.2:3306/opensips")
> But I still get error :
> ERROR:db_mysql:db_mysql_connect: driver error(2003): Can't connect to MySQL
> server on '10.14.11.2' (111)
>
> Is there any solution???
>
> thanks before.
>
>
> _______________________________________________
> Users mailing list
> [hidden email]
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>  


--
Bogdan-Andrei Iancu
www.voice-system.ro


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
12