haproxy 配置
yum -y install haproxy
vim /etc/haproxy/haproxy.cfg
UI页面:
listen monitor 0.0.0.0:8100
mode http
option httplog
stats enable
stats uri /stats
stats refresh 5s
tcp:
listen IQFDataTransferReplay 0.0.0.0:18661
mode tcp
option tcplog
balance roundrobin
server ferReplay2 172.19.78.88:18661 check inter 2000 rise 2 fall 3
server ferReplay1 172.19.78.83:18661 check inter 2000 rise 2 fall 3
server ferReplay3 172.19.78.89:18661 check inter 2000 rise 2 fall 3
http:
listen consul 0.0.0.0:8500
mode http
balance roundrobin
server c2 172.19.78.88:8500 check inter 2000 rise 2 fall 3
server c3 172.19.78.83:8500 check inter 2000 rise 2 fall 3
backend:
listen community
bind 0.0.0.0:15333
mode http
acl static_path_community path_beg -i /community
use_backend path_community if static_path_community
acl static_path_kolmanage path_beg -i /kolmanager
use_backend path_kolmanage if static_path_kolmanage
backend path_community
server community2 172.19.78.88:5308 check inter 2000 rise 2 fall 3
server community1 172.19.78.83:5308 check inter 2000 rise 2 fall 3
backend path_kolmanage
server kolmanage2 172.19.78.92:55059 check inter 2000 rise 2 fall 3
server kolmanage1 172.19.78.90:55059 check inter 2000 rise 2 fall 3