On Mon, 8 Sep 2008, Darren Mansell wrote:

Hello.

I'm trying to implement HA into some web servers, which are running
Tomcat.

Due to SSL shortcomings we have to use 1 IP address per web site and
can't virtualhost. This means on each web server we have around 20
aliased IP's so we can run around 20 instances of Tomcat all bound to
their own IP's.

this isn't a problem, I have boxes with many more VIPs than this.

I can set up Heartbeat with Ldirectord using 1 virtual IP as per the
many howtos on howtoforge (mainly this one
http://www.howtoforge.com/set-up-a-loadbalanced-ha-apache-cluster-ubuntu8.04-p4 
) and it works great. But as soon as I add any aliased IP's it stops working.

I'm using 4 Ubuntu 8.04.1 installs running in vmware for testing.

The config on the load balancers is:

ha.cf

logfacility local0
bcast eth0 # Linux
mcast eth0 225.0.0.1 694 1 0
auto_failback off
node hs-lb1
node hs-lb2
respawn hacluster /usr/lib/heartbeat/ipfail
apiauth ipfail gid=haclient uid=hacluster

haresources

hs-lb1 \
ldirectord::ldirectord.cf \
LVSSyncDaemonSwap::master \
IPaddr2::2.21.1.6/8/eth0/2.255.255.255 \
IPaddr2::2.21.1.9/8/eth0/2.255.255.255

normally I don't bother specifying all the details of the IP addresses, I would just do

hs-lb1 \
ldirectord::ldirectord.cf \
LVSSyncDaemonSwap::master \
2.21.1.6 \
2.21.1.9


ldirectord.cf

checktimeout=10
checkinterval=2
autoreload=no
logfile="local0"
quiescent=yes
virtual = 2.21.1.6:80
       real = 2.21.1.4:80 gate
       real = 2.21.1.5:80 gate
       service = http
       protocol = tcp
       checktype = negotiate
       request = "index.htm"
       scheduler = rr
virtual = 2.21.1.9:80
       real = 2.21.1.7:80 gate
       real = 2.21.1.8:80 gate
       service = http
       protocol = tcp
       checktype = negotiate
       request = "index.htm"
       scheduler = rr


ipvsadm -L -n shows:

IP Virtual Server version 1.2.1 (size=4096)
Prot LocalAddress:Port Scheduler Flags
 -> RemoteAddress:Port           Forward Weight ActiveConn InActConn
TCP  2.21.1.6:80 rr
 -> 2.21.1.4:80                  Route   1      0          0
 -> 2.21.1.5:80                  Route   1      0          0
TCP  2.21.1.9:80 rr
 -> 2.21.1.7:80                  Route   1      0          0
 -> 2.21.1.8:80                  Route   1      0          0


Which seems to suggest that heartbeat at least thinks everything is OK.

on your boxes running heartbeat just do an ifconfig and you should see eth0:0 and eth0:1 with your VIPs on them.


The 2 real web servers are set up like this:

what do your load balancers look like?

David Lang

/etc/network/interfaces

auto lo
iface lo inet loopback

auto lo:0
iface lo:0 inet static
address 2.21.1.6
netmask 255.255.255.255
pre-up sysctl -p > /dev/null

auto lo:1
iface lo:1 inet static
address 2.21.1.9
netmask 255.255.255.255
pre-up sysctl -p > /dev/null

auto eth0
iface eth0 inet static
address 2.21.1.4
netmask 255.0.0.0
gateway 2.3.1.18

auto eth0:0
iface eth0:0 inet static
address 2.21.1.7
netmask 255.0.0.0
gateway 2.3.1.18


As I say, if I remove the eth0:0 aliased IP from both nodes and
configure everything with just 1 virtual IP address gateway'ing to 2
real addresses it all works great.

Sorry if there's something simple I've overlooked, I'm very new to HA.

Thanks.

_______________________________________________
Linux-HA mailing list
[email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha
See also: http://linux-ha.org/ReportingProblems

Reply via email to