您的位置:首页 > 理论基础 > 计算机网络

Haproxy 4层TCP模式配置

2015-07-31 17:47 489 查看
vi /usr/local/haproxy/etc/haproxy.cfg

global
maxconn 100000
log /dev/log local0 notice

defaults
mode tcp
log global

option redispatch
stats enable
retries 3

timeout connect 5000ms
timeout client 50000ms
timeout server 50000ms

listen admin_stats :8964
mode http
stats enable
stats uri /monitor

frontend bbs
bind :29099
default_backend bbs

backend bbs
balance leastconn
server bbs-app-1_16400 bbs-app-1.prod.com:16400 weight 1 maxconn 4096 check inter 1000
server bbs-app-2_16400 bbs-app-2.prod.com:16400 weight 1 maxconn 4096 check inter 1000
server bbs-app-03_16400 bbs-app-3.prod.com:16400 weight 1 maxconn 4096 check inter 1000

frontend www
bind :29090
default_backend www

backend www
balance leastconn
server bbs-app-1_16400 bbs-app-1.prod.com:16400 weight 1 maxconn 4096 check inter 1000
server bbs-app-2_16400 bbs-app-2.prod.com:16400 weight 1 maxconn 4096 check inter 1000
server bbs-app-03_16400 bbs-app-3.prod.com:16400 weight 1 maxconn 4096 check inter 1000
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: