HA Proxy Set multiple Backends

HA Proxy Set multiple Backends #

用來在多個後端之中分配流量,HA Proxy 沒有想像中的那麼難用。

frontend proxy-in
        mode tcp
        bind 0.0.0.0:2048
        option tcplog
        default\_backend proxy-out

backend proxy-out
        mode tcp
        option tcplog
        option tcp-check
        balance roundrobin
        server s-01 s1.nova.moe:2048 check inter 5s fall 3 rise 10
        server s-02 s2.nova.moe:2048 check backup
        server s-03 s3.nova.moe:2048 check backup

這樣會在 s-01 掉線的時候自動切換到 s-02 啦~