[OpenSIPS-Users] Two Opensips proxies sharing the same DB

Jeff Pyle jpyle at fidelityvoice.com
Thu Jan 20 21:32:56 CET 2011


Hi Bogdan,

On 1/20/11 2:54 PM, "Bogdan-Andrei Iancu" <bogdan at opensips.org> wrote:

>Hi Jeff,
>
>Jeff Pyle wrote:
>> Hello,
>>
>> We're looking to add a second Opensips instance on a separate server
>> for failover. Or, from an operational perspective, it could be
>> described as "active-active" since both will be available at any one
>> time. We'll control the traffic flow to the proxies with the SRV
>> records used by the clients.
>>
>> Looking through the db tables used, it seems there may be some
>> conflict with the location and dialog tables.
>>
>> The usrloc module clearly saves the local socket used during the
>> registration. Is there a way to tell Opensips 1.6 to ignore this when
>> loading the record?
>socket;s are discarded at load time if not local.

I run db_mode=3 to keep everything current in the db.  The performance is
acceptable (MySQL cluster helps).  If I understand you correctly:  on a
shared table, if I save() a registration on Proxy A, but then load() it
into Proxy B, Proxy B will ignore it since the socket is non-local.  Any
way to work around that within Opensips itself?  If I ran separate
location tables on each, I might be able to work something up with MySQL
triggers to push a saved registration from one table to the other at
save()-time, changing the socket field as it goes.  That's a bit more
hackery than I was hoping to have to implement.

>> That way, either proxy can use records saved by either proxy. A force
>> socket option perhaps to the local IP? Clients are all public IPs ­ no
>> NAT.
>depends on what db_mode you use for usrloc - if you use a DB mode
>involving caching, the DB is read only at startup (otherwise, at
>runtime, it is just written), so data will not be shared at all. Of
>course you completely disable the usrloc caching via DB_ONLY db_mode,
>but the performance penalty is high - maybe you should consider register
>replication at SIP level.

Replication at the SIP level.  That is, have the SIP client register with
both proxies at once?

>>
>> The dialog table also saves the local sockets. Will there be a
>> conflict here? I don't expect the Opensips processes to use each
>> other's dialogs, so my goal is they will simply ignore each others'
>> records.
>simply use different "dialog" tables for the 2 instances - anyhow there
>is nothing to share here.

Ok, that makes sense.



- Jeff


>
>Regards,
>Bogdan
>
>>
>>
>>
>> - Jeff
>>
>>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> Users mailing list
>> Users at lists.opensips.org
>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>   
>
>
>-- 
>Bogdan-Andrei Iancu
>OpenSIPS Event - expo, conf, social, bootcamp
>2 - 4 February 2011, ITExpo, Miami,  USA
>OpenSIPS solutions and "know-how"
>
>
>_______________________________________________
>Users mailing list
>Users at lists.opensips.org
>http://lists.opensips.org/cgi-bin/mailman/listinfo/users




More information about the Users mailing list