我们有以下设置:
- 红帽 6
- LVS 设置为在两个网络服务器之间失败
- 连接持续时间为 900 秒
这是一个非常简单的设置,但是当服务器被标记为失败时,piranha/pulse/nanny 进程将表中服务器的权重标记为 0,并且不会删除失败的服务器。这意味着任何持久连接仍然附加到故障服务器并且负载平衡被破坏。
我们如何告诉 nanny 强制退出失败的节点,从而使与工作节点的持久连接失败?
谢谢
我们有以下 lvs.cf:
serial_no = 201305302344
primary = 10.1.1.45
service = lvs
backup = 0.0.0.0
heartbeat = 1
heartbeat_port = 539
keepalive = 6
deadtime = 18
network = nat
nat_router = 10.1.1.70 eth0:1
nat_nmask = 255.255.255.0
debug_level = NONE
virtual http {
active = 1
address = 10.1.1.70 eth0:1
vip_nmask = 255.255.255.0
persistent = 900
pmask = 255.255.255.0
port = 80
send = "GET / HTTP/1.0\r\n\r\n"
expect = "HTTP/1.1 200 OK"
use_regex = 0
load_monitor = none
scheduler = wlc
protocol = tcp
timeout = 6
reentry = 15
quiesce_server = 1
server web1 {
address = 10.1.1.51
active = 1
weight = 1
}
server web2 {
address = 10.1.1.52
active = 1
weight = 1
}
}
virtual https {
active = 1
address = 10.1.1.70 eth0:1
vip_nmask = 255.255.255.0
port = 443
persistent = 900
pmask = 255.255.255.0
send = "GET / HTTP/1.0\r\n\r\n"
expect = "up"
use_regex = 0
load_monitor = none
scheduler = wlc
protocol = tcp
timeout = 6
reentry = 15
quiesce_server = 1
server web1 {
address = 10.1.1.51
active = 1
weight = 1
}
server web2 {
address = 10.1.1.52
active = 1
weight = 1
}
}
尝试
echo 1 > /proc/sys/net/ipv4/vs/expire_quiescent_template
更多细节在这里:
http://www.austintek.com/LVS/LVS-HOWTO/HOWTO/LVS-HOWTO.persistent_connection.html
您必须在删除/添加该导演的导演失败/恢复时触发脚本。
我为此使用
lvs-kiss
它,它具有包含这些情况的脚本的语法。