I have 2 machines (with more or less the same specs) running
apache web server. I want setup "fos", where if one of the
2 machines goes done, the other takes over. On both machines
I have "lvs" installed. Does this following configuration make
sense?
P.S.
At one one point I tried to ssh to both machines and ended up on the
same machine. More than that, both machine have the alias "eth0:1"
which is the other machine private IP. I know I did no create it.
For the first machine
+++++++++++++++++/etc/sysconfig/ha/lvs.cfg++++++++++++++++++++++++++++
serial_no = 8
primary = some_ip
primary_private = 192.168.1.4
service = fos
backup = 0.0.0.0
heartbeat = 1
heartbeat_port = 539
keepalive = 6
deadtime = 18
network = direct
reservation_conflict_action = preempt
debug_level = NONE
failover vs1 {
address = 192.168.1.3 eth0:1
vip_nmask = 255.255.255.0
active = 1
port = 80
timeout = 6
send = "GET / HTTP/1.0\r\n\r\n"
expect = "HTTP"
start_cmd = "/etc/rc.d/init.d/httpd start"
stop_cmd = "/etc/rc.d/init.d/httpd stop"
}
+++++++++++++++++++++++++++++++++++++++++++
[root@web2 root]# /sbin/ipvsadm -L
IP Virtual Server version 0.9.7 (size=65536)
Prot LocalAddress:Port Scheduler Flags
-> RemoteAddress:Port Forward Weight ActiveConn InActConn
TCP web2.host:http rr
-> 192.168.1.3:http Local 1 0 0
============================================
For the second machine
++++++++++++/etct/sysconfig/ha/lvs.cfg+++++++++++++++++++++++++++++++
serial_no = 12
primary = some_ip
primary_private = 192.168.1.3
service = fos
backup = 0.0.0.0
heartbeat = 1
heartbeat_port = 539
keepalive = 6
deadtime = 18
network = direct
reservation_conflict_action = preempt
debug_level = NONE
failover vs2 {
address = 192.168.1.4 eth0:1
vip_nmask = 255.255.255.0
active = 1
port = 80
timeout = 6
send = "GET / HTTP/1.0\r\n\r\n"
expect = "HTTP"
start_cmd = "/etc/rc.d/init.d/httpd start"
stop_cmd = "/etc/rc.d/init.d/httpd stop"
}
++++++++++++++++++++++++++++++++++++++++++
Prot LocalAddress:Port Scheduler Flags
-> RemoteAddress:Port Forward Weight ActiveConn InActConn
TCP web1.host:http rr
-> 192.168.1.4:http Local 1 0 0
===================================================
|