[OpenSIPS-Users] Virtual_DB failover help

Jock McKechnie jock.mckechnie at gmail.com
Mon Dec 5 17:38:14 CET 2011


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



More information about the Users mailing list