[OpenSIPS-Users] Using Contact replication and HA
john.quick at smartvox.co.uk
Tue May 9 10:54:23 EDT 2017
I tried different scenarios and eventually ended up with the backup server having a listen statement for the VIP address.
Normally you cannot start OpenSIPS (or any other application) binding to an IP address that is not assigned on a local interface.
However, adding the line "net.ipv4.ip_nonlocal_bind = 1" to /etc/sysctl.conf I was then able to start OpenSIPS with that listen statement in place.
The backup server also listens on its own static IP using the proto_bin mechanism so it can receive and send replications while it is in "standby" mode.
That is the dilemma:
Replicated Contacts can only be useful if the backup server is able to take over the same VIP that was used on the primary server.
If the backup server does not use the VIP when it takes over as "active", then the replicated socket information in the location table will be wrong.
If OpenSIPS only starts on the backup server *after* that server has acquired the VIP then it could not receive the replicated Contacts using proto_bin when it was in standby mode.
From: Bogdan-Andrei Iancu [mailto:bogdan at opensips.org]
Sent: 09 May 2017 14:45
To: john.quick at smartvox.co.uk; OpenSIPS users mailling list <users at lists.opensips.org>
Subject: Re: [OpenSIPS-Users] Using Contact replication and HA
So, in your setup, on the backup server, OpenSIPS is not listening on the VIP address at all, right ?
OpenSIPS Founder and Developer
OpenSIPS Summit May 2017 Amsterdam
On 05/03/2017 04:46 PM, John Quick wrote:
> I am still working my way through some of the new features described
> at last year's Summit conference while you are all hopefully enjoying
> this year's Summit.
> I'm playing with the Clusterer module. It is a great idea but I am
> finding a few practical difficulties for contact replication in the USRLOC module.
> In my test rig, there are two almost identical OpenSIPS servers (A and B).
> Contact replication is enabled between the two servers and each server
> has its own local database.
> Linux HA - Corosync and Pacemaker - is used to control a Virtual IP
> (VIP) address resource. This allows UA's to register at the VIP
> address. HA decides which server has the virtual address at any given
> time, based on node availability. Currently, Server A is assigned the
> VIP and processes all UA registrations.
> Problem: The "socket" field in the location table contains the VIP
> address on both server A and B, but only Server A is bound to that
> address while both servers are up.
> Unless I completely disable NAT Pings in the nathelper module, Server
> B reports a lot of errors like this:
> 2017-05-03 14:15:51 CRITICAL:core:proto_udp_send: invalid
> sendtoparameters#012one possible reason is the server is bound to
> localhost and#012attempts to send to the net
> 2017-05-03 14:15:51 ERROR:nathelper:msg_send: send() for proto 1
> 2017-05-03 14:15:51 ERROR:nathelper:nh_timer: sip msg_send failed!
> Worse, if I also enable the "remove_on_timeout_bflag" option on Server
> B, it removes the registration on *both* servers after a short delay
> even though the UA is still available!
> Initially, I encountered problems with the HA IP Resource (or VIP)
> with respect to OpenSIPS not starting on server B because it was
> trying to bind to an address that was not currently assigned to any
> local interface. While it is possible to group the IP resource with
> the OpenSIPS service resource to overcome this problem, that would
> completely break USRLOC contact replication because the OpenSIPS
> service on Server B would not be running as long as Server A is up. I
> had to resort to an option in sysctl.conf that allows processes to
> start even if they are trying to bind to a non-local address.
> This makes me wonder what is the purpose of Usrloc Contact
> replication? Is there some other scenario that could use it and not have these problems?
> I also wonder what difference does the db_mode setting in Usrloc make
> when using contact replication.
> John Quick
> Smartvox Limited
> Users mailing list
> Users at lists.opensips.org
More information about the Users