Piranha/Pulse,lvs.cf 具有持久性和服务器故障

Piranha/Pulse,lvs.cf 具有持久性和服务器故障

我们有以下设置:

  • 红帽 6
  • 两个 Web 服务器之间的 LVS 设置失败
  • 连接持久性为 900 秒

这是一个非常简单的设置,但是当服务器被标记为故障时,piranha/pulse/nanny 进程会将表中该服务器的权重标记为 0,并且不会删除故障服务器。这意味着任何持久连接仍与故障服务器相连,并且负载平衡被破坏。

我们如何告诉保姆强制关闭故障节点,以便与工作节点的持久连接失败?

谢谢


我们有以下 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
     }
}

答案1

尝试echo 1 > /proc/sys/net/ipv4/vs/expire_quiescent_template

更多详情请点击这里:

http://www.austintek.com/LVS/LVS-HOWTO/HOWTO/LVS-HOWTO.persistent_connection.html

答案2

您必须在导演发生故障/恢复时触发一个脚本来删除/添加该导演。

我使用lvs-kiss它,它有一个包含这些情况的脚本的语法。

相关内容