1. 首页 > ITPUX技术网 > 正文

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

本文由风哥教程整理发布,仅用于学习测试使用,转载注明出处:http://www.fgedu.net.cn/10327.html

联系我们

在线咨询:点击这里给我发消息

微信号:itpux-com

工作日:9:30-18:30,节假日休息