Ha2

        timeout client 30000ms #客户端超时
        timeout server 30000ms #服务器超时
        #timeout check 2000 #=心跳检测超时
        log 127.0.0.1 local0 err #[err warning info debug]
        balance roundrobin                     #负载均衡算法
#        option  httplog                        #日志类别,采用httplog
#        option  httpclose   #每次请求完毕后主动关闭http通道,ha-proxy不支持keep-alive,只能模拟这种模式的实现
#        option  dontlognull
#        option  forwardfor  #如果后端服务器需要获得客户端真实ip需要配置的参数,可以从Http Header中获得客户端ip

listen admin_stats
        bind 0.0.0.0:8888 #监听端口
        option httplog #采用http日志格式
        stats refresh 30s #统计页面自动刷新时间
        stats uri /stats #统计页面url
        stats realm Haproxy Manager #统计页面密码框上提示文本
        stats auth admin:admin #统计页面用户名和密码设置
        #stats hide-version #隐藏统计页面上HAProxy的版本信息

listen test1
        bind :9804
        mode tcp
        maxconn 4000

       server t1 10.100.100.28:5269
        server t2 10.100.100.30:5269
        server t3 10.100.100.31:5269

猜你喜欢

转载自zhoushijun.iteye.com/blog/1624513
Ha2
1-2