Re: Asterisk Load Balancing with Ultramonkey

Simon Horman <[email protected]> Tue, 28 Apr 2009 16:13:54 +1000
Newsgroups gmane.linux.highavailability.ultramonkey
Message-ID <[email protected]>
On Fri, Apr 24, 2009 at 04:49:01PM +0700, Kurt Weasel wrote:
> Hi,
> 
> I have some problems to do asterisk load balancing with Ultramonkey.
> I am trying to do asterisk (http://www.asterisk.org) load balancing with SIP
> protocol.
> The topology used is streamline high availability and load balancing (
> http://www.ultramonkey.org/3/topologies/sl-ha-lb-eg.html) i.e 2 linux
> directors / real servers.
> The OS I used for both directors / servers is Ubuntu 8.04 .Then I use
> configuration exactly as it is presented in the example except for node name
> and some changes.
> 
> Since I am using SIP, I add the following lines to ldirectord.cf file
> 
> *checktimeout=10
> checkinterval=2
> autoreload=no
> quiescent=yes
> logfile="/var/log/ldirectord.log"
> 
> virtual=192.168.6.240:5060 gate
>   real=192.168.6.2:5060 gate
>   real=192.168.6.3:5060 gate
>   service=sip
>   scheduler=rr
>   persistent=600
>   protocol=udp
>   checktype=connect*
> 
> After all files are already configured, I stop the ldirectord and start
> heartbeat as instructed. I check the master linux-director and says that
> master running in server 1 (192.168.6.2) and master stopped in server 2
> (192.168.6.3). Then I try to stop the heartbeat in server 1, the server 2
> becomes the master. So in general, the heartbeat and ldirectord is working
> theoretically.
> 
> Then, I restart both of my servers (server 1 becomes the master again) and
> start asterisk service for both servers. After that, a client PC with an IP
> of 192.168.6.101 is configured using X-Lite softphone to connect server
> 192.168.6.240. Server 1 (with IP 192.168.6.2 which assumes the role of
> Virtual IP address 192.168.6.240) detect this and the X-Lite shows status
> ready. This can be verified using command (you need asterisk installed to
> verify this) :
> 
> *asterisk
> asterisk - r
> *CLI> sip show peers*
> 
> Then I try to test failover and entirely shutdown the Server 1. Then Server
> 2 assumes the master status theoretically (verified by using command
> */etc/ha.d/resource.d/LVSSyncDaemonSwap
> master status*).
> 
> However, the real failover doesn't occur. When the client try to connect
> 192.168.6.240, it seems it can't find the asterisk service that is running
> at 192.168.6.240. However when I ping both 192.168.6.240 and 192.168.6.3,
> both server show respond.
> 
> Then I configure the X-Lite softphone to connect server 192.168.6.3. And it
> shows connected. But it doesn't happen that way when I connect to
> 192.168.6.240
> 
> My question is why after the failure of server 1, asterisk at server 2 can't
> assume server role? Theoretically, when the softphone try to connect to
> 192.168.6.240, asterisk at server 2 should detect this. Can someone give
> tips of what should be done to make this right? Anyone has an experience
> with this? Thank you.

Hi Kurt,

as you are using "gate" aka LVS-DR, my first instinct would be
to check that you have ARP properly - that is that the linux-director
is responding to ARP requests for the VIP (192.168.6.240) and not
one of the real-servers.

If the end-user is on the same physical network as the real-server,
then you should be able to check this by verifying that the MAC
address the end-user is using for the VIP is that of the linux-director.
On linux the arp command can be used.

Alternatively, regardless of where the end-user is, if you use tcpdump or
similar and inspect the source MAC address of packets on the real-server
(or to be more presise, the server the end-user appears to be connecting
to), then they should be that of linux-director, not that of the end-user
or the machine (router) that the end-user's packets are received via.


-- 
Simon Horman
  VA Linux Systems Japan K.K. Satellite Lab in Sydney, Australia
  H: www.vergenet.net/~horms/            W: www.valinux.co.jp/en

_______________________________________________
Ultramonkey-users mailing list
[email protected]
http://lists.vergenet.net/listinfo/ultramonkey-users