关于LVS本地节点
我希望实现双节点的双运行模式运行HTTP,但实际应用中,只有本点节点返回了页面信息,即使本节点的HTTP服务停了,也不会转到另外一台服务器上,如:
当前192.168.222.11是当前运行的LVS Route,就只有11返回页面,我手工stop了11上的HTTP服务,访问192.168.222.10时直接就找不到页面了,也就是没有返回。是不是我有什么东东设错了?
我的lvs.cf文件如下:
serial_no = 22
primary = 192.168.222.11
primary_private = 10.1.1.11
service = lvs
backup_active = 1
backup = 192.168.222.12
backup_private = 10.1.1.12
heartbeat = 1
heartbeat_port = 539
keepalive = 6
deadtime = 18
network = direct
debug_level = NONE
monitor_links = 0
virtual http {
active = 1
address = 192.168.222.10 eth1:1
vip_nmask = 255.255.255.0
port = 80
send = "GET / HTTP/1.0\r\n\r\n"
expect = "HTTP"
use_regex = 0
load_monitor = none
scheduler = wlc
protocol = tcp
timeout = 6
reentry = 15
quiesce_server = 0
server node1 {
address = 192.168.222.11
active = 1
weight = 1
}
server node2 {
address = 192.168.222.12
active = 1
weight = 1
}
}
192.168.222.11下执行ipvsadm
IP Virtual Server version 1.2.1 (size=4096)
Prot LocalAddress:Port Scheduler Flags
-> RemoteAddress:Port Forward Weight ActiveConn InActConn
TCP 192.168.222.10:http wlc
-> 192.168.222.11:http Local 1 0 0
-> 192.168.222.12:http Remote 1 0 0
两台node都有
iptables -t nat -A PREROUTING -p tcp -d 192.168.222.10 --dport 80 -j REDIRECT