haproxy安装配置
[font=punctuation, 微软雅黑, Tohoma]global
log 127.0.0.1 local0
#log 127.0.0.1 local1 notice
#log loghost local0 info
maxconn 4096
chroot /usr/local/haproxy
uid 99
gid 99
daemon
nbproc 1
pidfile /usr/local/haproxy/haproxy.pid
#debug
#quiet
defaults
log 127.0.0.1 local3
cookie JSESSIONID prefix
mode http
option httplog
option httpclose
option dontlognull
option forwardfor
option redispatch
retries 2
maxconn 2000
balance roundrobin
stats uri /haproxy-stats
stats auth admin:admin
contimeout 5000
clitimeout 50000
srvtimeout 50000
listen web_proxy 192.168.0.100:80
option httpchk GET /index.html
server s1 192.168.0.101:80 cookie main3 check inter 2000 rise 2 fall 5
server s2 192.168.0.102:80 cookie main3 check inter 2000 rise 2 fall 5[font=punctuation, 微软雅黑, Tohoma]启动服务:
# /usr/local/haproxy/sbin/haproxy -f /usr/local/haproxy/haproxy.cfg
重启服务:
# /usr/local/haproxy/sbin/haproxy -f /usr/local/haproxy/haproxy.cfg -st `cat /usr/local/haproxy/haproxy.pid`
停止服务:
# killall haproxy