Virtual DB failover wrangling

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

Virtual DB failover wrangling

Jock McKechnie
Greetings folks;

I've been attempting to get a working db_virtual failover setup going and am having some very basic functionality problems while in testing, I was wondering if someone could shed some light one what I, presumably, am doing wrong.

Appropriate sections of config look something like this:
------------------------
modparam("alias_db", "db_url", "virtual://set1")

modparam("db_virtual", "db_max_consec_retrys", 3)

modparam("db_virtual","db_urls","define set1 FAILOVER")
modparam("db_virtual","db_urls","mysql://opensips:password@192.168.0.100/aliasdb")
modparam("db_virtual","db_urls","mysql://opensips:password@192.168.0.200/aliasdb")

if (alias_db_lookup("opensips_inbound", "d")) {
        # Do something
        };
------------------------

I'm running the Debian package release, 1.6.0-1, from the leurent.eu repository.

If I start OpenSIPs and then on the .100 DB do an iptables REJECT to simulate a DB problem OpenSIPs will simply retry the alias lookup infinitely.

Curiously, if I set up the iptables block, THEN start OpenSIPs, and toggle the block on and off, the failure mode appears to work as it should, which really confuses me.

Have I got an issue with how I expect this to work? How I've got it set up? Or do we think my testing methodology is bunk?

My many thanks;

 - Jock

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

Re: Virtual DB failover wrangling

Bogdan-Andrei Iancu
Hi Jock,

Jock McKechnie wrote:

> Greetings folks;
>
> I've been attempting to get a working db_virtual failover setup going
> and am having some very basic functionality problems while in testing,
> I was wondering if someone could shed some light one what I,
> presumably, am doing wrong.
>
> Appropriate sections of config look something like this:
> ------------------------
> modparam("alias_db", "db_url", "virtual://set1")
>
> modparam("db_virtual", "db_max_consec_retrys", 3)
>
> modparam("db_virtual","db_urls","define set1 FAILOVER")
> modparam("db_virtual","db_urls","mysql://opensips:password@192.168.0.100/aliasdb
> <http://opensips:password@192.168.0.100/aliasdb>")
> modparam("db_virtual","db_urls","mysql://opensips:password@192.168.0.200/aliasdb
> <http://opensips:password@192.168.0.200/aliasdb>")
>
> if (alias_db_lookup("opensips_inbound", "d")) {
>         # Do something
>         };
> ------------------------
>
> I'm running the Debian package release, 1.6.0-1, from the leurent.eu
> <http://leurent.eu> repository.
>
> If I start OpenSIPs and then on the .100 DB do an iptables REJECT to
> simulate a DB problem OpenSIPs will simply retry the alias lookup
> infinitely.
the retry is from mysql lib or from opensips mysql module ?
>
> Curiously, if I set up the iptables block, THEN start OpenSIPs, and
> toggle the block on and off, the failure mode appears to work as it
> should, which really confuses me.
The difference may come from the fact that the failure is detected at
startup - if you start with the DB server down, opensips will not
connect at all at that DB.

Have you tried to start opensips with all DB servers up and simple stop
the primary one ? does this case work ?
>
> Have I got an issue with how I expect this to work? How I've got it
> set up? Or do we think my testing methodology is bunk?
I would rather say there is something wrong in the DB virtual...

I will try asap to make a test setup to see what exactly is going on

Regards,
Bogdan

>
> My many thanks;
>
>  - Jock
> ------------------------------------------------------------------------
>
> _______________________________________________
> 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
Reply | Threaded
Open this post in threaded view
|

Re: Virtual DB failover wrangling

Jock McKechnie

Greetings Bogdan;

On Fri, Mar 12, 2010 at 5:29 AM, Bogdan-Andrei Iancu <[hidden email]> wrote:
> If I start OpenSIPs and then on the .100 DB do an iptables REJECT to
> simulate a DB problem OpenSIPs will simply retry the alias lookup
> infinitely.

the retry is from mysql lib or from opensips mysql module ?

You know, I'm not sure. The way I knew it was retrying was by watching port 3306 traffic via ngrep. How would be able to tell which lib was initiating the retry?
 
>
> Curiously, if I set up the iptables block, THEN start OpenSIPs, and
> toggle the block on and off, the failure mode appears to work as it
> should, which really confuses me.
The difference may come from the fact that the failure is detected at
startup - if you start with the DB server down, opensips will not
connect at all at that DB.

Have you tried to start opensips with all DB servers up and simple stop
the primary one ? does this case work ?

No, unfortunately not. This case it retries repeatedly without end, apparently.
 
>
> Have I got an issue with how I expect this to work? How I've got it
> set up? Or do we think my testing methodology is bunk?
I would rather say there is something wrong in the DB virtual...

I will try asap to make a test setup to see what exactly is going on
 
Thank you very much, Bogdan! Let me know what I can do to help, if anything.

 - Jock


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