[OpenSIPS-Users] Two Opensips proxies sharing the same DB
Jeff Pyle
jpyle at fidelityvoice.com
Thu Jan 20 22:02:14 CET 2011
Bogdan,
I think I've got it now. Details inline.
On 1/20/11 3:44 PM, "Bogdan-Andrei Iancu" <bogdan at opensips.org> wrote:
>Jeff Pyle wrote:
>>>> 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.
>the socket is ignored, not the record - the record will be used, but the
>socket info discarded
Ah ha! So it will work on a shared table, and the default socket of
"Proxy B" will be used in the scenario I described. Excellent.
>
>> 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?
>>
>yes. UAC registers with P1 and P1 replicates to P2 (see the
>t_replicate() function in TM module). But again, this makes sense only
>if using cache for usrloc
Indeed. I see now. Thanks.
- Jeff
>
>
>Regards,
>Bogdan
>
>--
>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