1.安装HAProxy
# yum install haproxy
2. 修改配置文件
# vim /etc/haproxy/haproxy.cfg
3.编辑配置文件内容:
global
ulimit-n 51200
defaults
log global
mode tcp
option dontlognull
contimeout 10000
clitimeout 150000
srvtimeout 150000
# 前端请求拦截
frontend frontend1
bind *:8888
default_backend backend1 #和后端转发地址对应
# 后端转发地址 1
backend backend1
server server1 127.0.0.1:8080 maxconn 20480
# 后端转发地址 2
backend backend2
server server1 127.0.0.1:9080 maxconn 20480
4. 启动服务
# service haproxy start
5. 关闭服务
# service haproxy stop
最后
以上就是完美万宝路最近收集整理的关于Linux安装HAProxy和简单使用的全部内容,更多相关Linux安装HAProxy和简单使用内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复