q490880 发表于 2015-7-28 11:48:17

第一次接触 haproxy

本帖最后由 q490880 于 2015-7-28 13:45 编辑

我是一个程序猿兼运维,以前只是负责一台服务器,但随着访问量越来越多一台服务器明显不够用了,现在开始正式接触高大上的集群。

首先根据这个贴子里的介绍安装了haproxy
http://www.iyunv.com/forum.php?mod=viewthread&tid=84595&highlight=haproxy

但在启动时提示 staring proxy admin_status : cannot bind socket
更换端口,卸载apache,并且开启了net.ipv4.ip_nonlocal_bind=1 依然提示错误

最后在 公告版主-kernel 帮助下更改了配置文件的bind端口,成功启动haproxy

listen web_proxy 192.168.20.112:8000server web1 192.168.20.137:8000 cookie app1inst1 check inter 2000 rise 2 fall 5server web2 192.168.20.140:8000 cookie app1inst2 check inter 2000 rise 2 fall 5
listen admin_status
      bind *:8001(教程里这里是8000需要改成8001,说明:bind和监听端口不能一样)
      modehttp
      statsenable
      statsuri /admin?status
      statsauth yzg:yzg1314520
      statsrefresh 5
      statshide-version

启动haproxy却访问不了192.168.2.109:8000/admin?status 控制台页面
关闭防火墙后成功访问!
页: [1]
查看完整版本: 第一次接触 haproxy