hi List, I have a 2-server heartbeat plus ldirectord setup to load balance my nginx services. I have the following setup in my specific case:
-- both servers are used as node of heartbeat, and the real server (nginx) -- have 2 IPs bound to eth0 and eth0:0 (I have to HA these 2 IPs) -- lo:0 and lo:1 are used to stored the VIPs when the node is in standby mode -- using direct routing in the ldirectord I added the following section to /etc/ha.d/haresources so all the two IPs can be took over by the standby machine when I shutdown the active one, so this is basically working: s1 \ ldirectord::ldirectord.cf \ LVSSyncDaemonSwap::master \ IPaddr2::VIP1/26/eth0/x.x.x.x \ IPaddr2::VIP2/28/eth0:0/x.x.x.x When I use ipvsadm, I see something like this: Prot LocalAddress:Port Scheduler Flags -> RemoteAddress:Port Forward Weight ActiveConn InActConn TCP VIP1:http rr -> RIP1-2:http Route 1 174 0 -> RIP1-1:http Local 1 2 13 TCP VIP2:http rr -> RIP2-2:http Route 1 712 0 -> RIP2-1:http Local 1 20 45 My questions are: 1) Are RIP1-1 and RIP2-1 being recognized as "Local" correct? RIP1-1 and RIP2-1 are the IPs of the active node. 2) Why the remote (Route) server is taking much more requests than the local one? 3) Why the local server has a large number of "InActConn"? I tried to shutdown the nginx on the remote server and saw the RIP1-2 and RIP2-2 being removed from the above table correctly, and my service is still up, which means the RIP1-1 and RIP2-1 are serving properly. My /etc/ha.d/ldirectord.cf # Global Directives checktimeout=10 checkinterval=2 #fallback=127.0.0.1:80 autoreload=no logfile="/var/log/ha/ldirectord.log" #logfile="local0" emailalert="[email protected]" emailalertfreq=3600 emailalertstatus=all quiescent=no virtual=VIP1:80 real=RIP1-1:80 gate real=RIP1-2:80 gate #fallback=127.0.0.1:80 gate service=http request="/ldirector.html" receive="ha" scheduler=rr #persistent=600 protocol=tcp checktype=negotiate # Sample for an http virtual service virtual=VIP2:80 real=RIP2-1:80 gate real=RIP2-2:80 gate #fallback=127.0.0.1:80 gate service=http request="/ldirector.html" receive="ha" scheduler=rr #persistent=600 protocol=tcp checktype=negotiate Any help is appreciated. Regards, Yan _______________________________________________ Please read the documentation before posting - it's available at: http://www.linuxvirtualserver.org/ LinuxVirtualServer.org mailing list - [email protected] Send requests to [email protected] or go to http://lists.graemef.net/mailman/listinfo/lvs-users
