haproxy配置tcp负载均衡

#---------------------------------------------------------------------
# 监控页面
#---------------------------------------------------------------------
listen admin_stats
bind 0.0.0.0:1080
mode http
option httplog
stats refresh 30s
stats uri /stats
stats realm Haproxy Manager
stats auth admin:admin


#---------------------------------------------------------------------
# 后台服务 test frontend which proxys to the backends
#---------------------------------------------------------------------
listen keyservice
bind 0.0.0.0:9996
mode tcp
balance roundrobin
server s1 127.0.0.1:9995 weight 1 maxconn 100000 check inter 10s

 

启动失败,绑定端口失败处理方法
setsebool -P haproxy_connect_any=1

 

posted @ 2017-11-10 14:08  jiftle  阅读(850)  评论(0编辑  收藏  举报