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
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