haproxy 설치 Linux
2014.01.23 16:43 Edit
[root@localhost ~]#cd /usr/local/src
[root@localhost src]#wget http://haproxy.1wt.eu/download/1.4/src/haproxy-1.4.22.tar.gz
[root@localhost src]#tar xfvz haproxy-1.4.22.tar.gz
[root@localhost src]#cd haproxy-1.4.22
[root@localhost haproxy-1.4.22]#make install
[root@localhost haproxy-1.4.22]#vi /etc/haproxy.conf
------------------------------------------------------------
global
log 127.0.0.1 local0
log 127.0.0.1 local1 notice
# log loghost local0 info
maxconn 4096
# chroot /usr/share/haproxy
uid 99
gid 99
daemon
#debug
#quiet
defaults
log global
mode tcp
option dontlognull
retries 3
# option redispatch
# stats uri /haproxy
maxconn 4096
contimeout 2d
clitimeout 2d
srvtimeout 2d
listen port1 0.0.0.0:80
balance leastconn
server inst1 222.239.255.37:80
listen port2 0.0.0.0:9999
balance leastconn
server inst1 222.239.255.37:9999
------------------------------------------------------------
[root@localhost haproxy-1.4.22]#haproxy -f /etc/haproxy.conf
[root@localhost haproxy-1.4.22]#netstat -natlp