加入收藏 | 设为首页 | 会员中心 | 我要投稿 云计算网_宿迁站长网 (https://www.0527zz.com/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 服务器 > 搭建环境 > Linux > 正文

centos 6.3下haproxy和apache的配置过程

发布时间:2016-09-15 06:18:11 所属栏目:Linux 来源:站长网
导读:一.什么是haproxy HAProxy提供高可用性、负载均衡以及基于TCP和HTTP应用的代理,支持虚拟主机,它是免费、快速并且可 靠的一种解决方案。HAProxy特别适用于那些

四.启动haproxy

启动haproxy

# /usr/local/haproxy/sbin/haproxy -f /usr/local/haproxy/haproxy.cfg

查看是否启动

# ps -ef|grep haproxy

--------------------------

avahi     1430     1  0 01:35 ?        00:00:00 avahi-daemon: running [haproxy.local]

haproxy  36112     1  0 03:43 ?        00:00:00 /usr/local/haproxy/sbin/haproxy -f /usr/local/haproxy/haproxy.cfg

haproxy  36113     1  0 03:43 ?        00:00:00 /usr/local/haproxy/sbin/haproxy -f /usr/local/haproxy/haproxy.cfg

root     36168  2002  0 04:02 pts/0    00:00:00 grep haproxy

--------------------------

重启haproxy

# pkill haproxy

# /usr/local/haproxy/sbin/haproxy -f /usr/local/haproxy/haproxy.cfg

其中:

haproxy server监听的端口:80

client1代理:192.168.7.196:80

client2代理:192.168.7.197:80

统计页面监听的端口:8888

访问页面:

http://192.168.7.198:8888/haproxy-stats

认证账号/密码:haproxy/password

总结:

用户只需访问http://192.168.7.198即可随机跳转到client1或client2页面,只要haproxy server 服务不挂掉,即使挂掉任意一台client1或client2服务器,另外一台也会实时接管web服务,实现web服务高可 用性与负载均衡。

查看本栏目更多精彩内容:http://www.bianceng.cn/OS/Linux/

centos 6.3下haproxy和apache的配置过程

centos 6.3下haproxy和apache的配置过程

centos 6.3下haproxy和apache的配置过程

(编辑:云计算网_宿迁站长网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!