haproxy安装配置

教程发布:风哥 教程分类:ITPUX技术网 更新日期:2022-02-12 浏览学习:259

[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

本文标签:
本文标题:haproxy安装配置
网站声明:本文由风哥整理发布,转载请保留此段声明,本站所有内容将不对其使用后果做任何承诺,请读者谨慎使用!
【上一篇】
【下一篇】