Server Deployment - Haproxy

Server Deployment - Haproxy

I will install the latest package in my system. I use it as software solution of hardware F5.

1. Install haproxy
download this file haproxy-1.4.15.tar.gz
unzip the file
>tar zxvf haproxy-1.4.15.tar.gz

move the file to work directory
>mv /home/luohua/soft_bak/haproxy-1.4.15 /home/luohua/tools/
>cd /home/luohua/tools/haproxy-1.4.15
compile the make file and install
>make TARGET=linux26
>make install

2. my configuration file, haproxy.conf:

global
daemon
maxconn 256
log 127.0.0.1 local0
debug
#quiet

defaults
log 127.0.0.1 local3
mode http
option httplog
option httpclose
option dontlognull
option forwardfor
option redispatch
retries 2
maxconn 2000
balance roundrobin
stats uri /haproxy-stats
timeout connect 5000ms
timeout client 50000ms
timeout server 50000ms

listen web_proxy 0.0.0.0:82
option httpchk GET /easymarket/index.jsp

server s1 127.0.0.1:8083 weight 3 check
server s2 127.0.0.1:8084 weight 3 check
server s3 127.0.0.1:8085 weight 3 check

3. command to start the server
>haproxy -f haproxy.conf

I met a problem said:
Starting proxy web_proxy: cannot bind socket

my solution:
>vi /etc/sysctl.conf
net.ipv4.ip_nonlocal_bind=1

and start the haproxy with root or
>sudo haproxy -f haproxy.conf

4. We can see the status of this server on URL:
http://localhost:82/haproxy-stats
http://localhost:82/easymarket

references:
http://hi.baidu.com/luohuazju/blog/item/5d8e2d3eb723eef3828b1312.html
http://hi.baidu.com/luohuazju/blog/item/f74f7ac4e94a97a08226ac14.html
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值