HAProxy
来源:互联网 发布:趣头条软件 编辑:程序博客网 时间:2024/09/15 12:19
rhel6.4以后rpm中有自带
[root@test~]# vim /etc/udev/rules.d/70-persistent-net.rules
[root@80Packages]# yum install haproxy-1.4.24-2.el6.i686.rpm -y
[root@80Packages]# rpm -ql haproxy
[root@80Packages]# man haproxy
[root@80~]# cp /etc/haproxy/haproxy.cfg /etc/haproxy/haproxy.cfg.bak
[root@80~]# vim /etc/sysconfig/rsyslog
SYSLOGD_OPTIONS="-c2 -r"
[root@80~]# vim /etc/rsyslog.conf
local2.* /var/log/haproxy.log
[root@80~]# service rsyslog restart
[root@80~]# vim /etc/haproxy/haproxy.cfg
在第59行:.,$d删除当前行到尾
[root@80~]# vim /etc/haproxy/haproxy.cfg
option redispatch
retries 3
timeout http-request 10s
timeout queue 1m
timeout connect 10s
timeout client 1m
timeout server 1m
timeout http-keep-alive 10s
timeout check 10s
maxconn 3000
listenstats
mode http
bind 0.0.0.0:1080
stats enable
stats hide-version
stats uri /haproxyadmin?stats
stats realm Haproxy\ Statistics
stats auth admin:admin
stats admin if TRUE
frontendweb
bind *:80
log global
option httpclose
option logasap
option dontlognull
capture request header Host len 20
capture request header Referer len 60
default_backend servers
backendservers
balance roundrobin
server web1 192.168.19.248:80 check maxconn 4000
server web2 192.168.19.249:80 check maxconn 3000
[root@80 ~]# haproxy–c
[root@80~]# service haproxy start
[root@80 ~]# netstat–ntlp
[root@80 ~]# ps–auxf
- haproxy
- HAProxy
- HAProxy
- HAProxy
- haproxy
- HAPROXY
- HAProxy
- HAProxy
- HAProxy
- HAproxy
- HAProxy
- haproxy
- haproxy
- HAProxy
- HAProxy
- HAProxy
- haproxy
- HAProxy
- 【UI更新机制】handler
- TCPlistener和TCPClient
- tcplistener TcpClient UdpClient
- 软件正在改变世界,为什么程序员却得不到足够的尊重?
- js 获取当前日期的前几个月
- HAProxy
- 解决 MySQL 5.7 中 Your password does not satisfy the current policy requirements. 问题
- 百度地图的集成和简单使用
- zynq-7000学习笔记(八)——USB摄像头图像采集
- Aidl多进程通信
- Retrofit api 翻译
- linux下ixgbe网卡应用点滴
- RxJava的简单使用
- 百度地图使用