Redhat

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

  • June 11, 2013

我們有以下設置:

  • 紅帽 6
  • LVS 設置為在兩個 Web 伺服器之間失敗
  • 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這個,它有一個語法來包含這些案例的腳本。

引用自:https://serverfault.com/questions/515032