0
我有兩個HAProxy實例/對等點。我希望如果一個人失敗,應用程序就會開始使用其他。如何在HAProxy對象之間自動切換
這是有關部分從haproxy.cfg
backend haproxy_http
stick-table type ip size 20k peers hapeers
stick on src
balance roundrobin
option tcp-check
server n1 someIP check port 80
server n2 someIP2 check port 80
peers hapeers
peer ha1 haproxyIP1:1024
peer ha2 haproxyIP2:1024
有運行兩個差異容器/ 搬運工服務 2個HAProxy的實例。
在一個實例中,我的應用程序只連接到由唯一HAProxy服務器顯示的端口。在兩個實例中,我不知道如何自動切換到其他實例,因爲我現在有兩個端口(由HAProxy1和其他HAProxy2顯示)。
喜歡的東西:
- 嘗試連接到HAProxy1。
- HAProxy1已關閉;連接到HAProxy 2.