[OpenSIPS-Users] Virtual_DB failover help

Bogdan-Andrei Iancu bogdan at opensips.org
Tue Dec 6 18:28:25 CET 2011


Hi Jock,

Could you post logs in debug 6 for the query that should failover ?

Thanks and regards,
Bogdan

On 12/05/2011 06:38 PM, Jock McKechnie wrote:
> Greetings;
>
> I was wondering if someone could point me in the right direction
> regarding use of virtual_db in a failover mode. I'm unable to get it
> to failover at all, OpenSIPS just continually resends the query to the
> initial system without ever attempting to try the secondary DB.
>
> modparam("db_virtual", "db_urls", "define set1 FAILOVER")
> modparam("db_virtual", "db_urls",
> "mysql://opensips:passsword@192.168.99.100/opensips")
> modparam("db_virtual", "db_urls",
> "mysql://opensips:passsword@192.168.99.60/opensips")
>
> modparam("dispatcher", "db_url", "virtual://set1")
> modparam("alias_db", "db_url", "virtual://set1")
> .
> .
> if (!alias_db_lookup("openser_inbound", "d")) {
>          # Do stuff
>          }
>
>
> Which results, on my ngrep -qt '' 'port 3306':
> T 2011/12/05 08:34:44.824823 192.168.1.1:43648 ->  192.168.99.100:3306 [AP]
>    P....select username,domain from opensips_inbound where
> alias_username='18001231234'
>
> T 2011/12/05 08:34:44.995638 192.168.1.1:43651 ->  192.168.99.100:3306 [AP]
>    P....select username,domain from opensips_inbound where
> alias_username='18001231234'
>
> T 2011/12/05 08:34:45.025376 192.168.1.1:43648 ->  192.168.99.100:3306 [AP]
>    P....select username,domain from opensips_inbound where
> alias_username='18001231234'
>
> T 2011/12/05 08:34:45.197299 192.168.1.1:43651 ->  192.168.99.100:3306 [AP]
>    P....select username,domain from opensips_inbound where
> alias_username='18001231234'
>
> Ad infinitum.
>
> I'm testing by having all the DBs up, starting OpenSIPS (version
> 1.6.4), doing an initial call to verify things are working. I then
> simulate a connection failure by adding a route reject on the database
> server, so as to make it look like the DB completely fell off the
> network, and retry the call with the above result. My reading of the
> documentation suggests that after a certain number of tries (I believe
> 10), virtual_db should attempt to use the second DB (192.168.99.60),
> but this just doesn't happen.
>
> What am I missing here?
>
> My thanks to all;
>   - Jock
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>


-- 
Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
OpenSIPS solutions and "know-how"




More information about the Users mailing list