# this config needs haproxy-1.1.28 or haproxy-1.2.1
global
log 127.0.0.1 local0
log 127.0.0.1 local1 notice
#log loghost local0 info
maxconn 4096
tune.bufsize 20480
tune.maxrewrite 2048
#chroot /usr/share/haproxy
user haproxy
group haproxy
daemon
#debug
#quiet
defaults
log global
mode tcp
option tcplog
option dontlognull
option tcp-smart-accept
option tcp-smart-connect
#option dontlog-normal
retries 3
option redispatch
timeout connect 1h
timeout client 1h
timeout server 1h
maxconn 40000
option redispatch
listen rabbitmq_cluster 0.0.0.0:5672
mode tcp
maxconn 2000
balance roundrobin
server rabbit1 172.20.21.1:5672 check inter 2000 rise 2 fall 3
server rabbit2 172.20.21.2:5672 check inter 2000 rise 2 fall 3
server rabbit3 172.20.21.3:5672 check inter 2000 rise 2 fall 3
listen mariadb_cluster
bind 0.0.0.0:3306
mode tcp
#option tcpka
option mysql-check user haproxy #mysql.... root.mysql.....
#balance leastconn #....
balance roundrobin
server mysql1 172.20.21.1:3306 weight 1 check inter 1s rise 2 fall 2
server mysql2 172.20.21.2:3306 weight 1 check inter 1s rise 2 fall 2
server mysql3 172.20.21.3:3306 weight 1 check inter 1s rise 2 fall 2
listen ssdb_cluster 0.0.0.0:8888
mode tcp
maxconn 2000
balance roundrobin
server ssdb1 172.20.21.1:8888 check inter 2000 rise 2 fall 3
server ssdb2 172.20.21.2:8888 check inter 2000 rise 2 fall 3
listen 49 0.0.0.0:3389
mode tcp
maxconn 2000
balance source
option tcpka
server 49 172.20.0.49:3389 check inter 2000 rise 2 fall 3
listen stats :1936
mode http
stats enable
stats hide-version
stats realm Haproxy\ Statistics
stats uri /
stats auth admin:admin