728x90
반응형
3. Load Balancer(L4/L7) "haproxy" Build, Install and Configuration
Active/Standby Node에 아래와 같은 과정을 통해 haproxy를 설치한다.
- Download haproxy Lastest version (2013년 2월 현재 1.4.22)
- Tarball 전개 (# (shop)은 root previlege를 의미한다.)
- # tar xvzf ./haproxy-1.4.22.tar.gz
- Build
- # make TARGET=linux26 ARCH=x86_64
- Install
- # make install
- Make Configuration File
- # mkdir /etc/haproxy
- /etc/haproxy/haproxy.cfg
- 서비스를 VIP와 binding하기 위해서는 반드시 bind 192.168.0.10:80으로 설정
- 그 밖의 Configuration은 Link를 참조한다. http://cbonte.github.com/haproxy-dconv/configuration-1.4.html
global
daemon
group daemon
user daemon
pidfile /var/run/haproxy.pid
defaults
mode http
log global
stats enable
listen Service_Name
bind 192.168.0.10:80
balance roundrobin
server RN1 192.168.0.21:80
server RN2 192.168.0.22:80
server RN3 192.168.0.23:80
server RN4 192.168.0.24:80
- Builded Binary를 LSB(Linux Standard Base)에 맞춤 (LSB: http://en.wikipedia.org/wiki/Linux_Standard_Base, http://linux-ha.org/wiki/LSB_Resource_Agents)
- Download http://haproxy.1wt.eu/download/contrib/haproxy.init.el5
- # chmod 755 ./haproxy.init.el5
- # mv ./haproxy.init.el5 /etc/init.d/haproxy
- # ln -s /usr/local/sbin/haproxy /usr/sbin/haproxy
- Check
# /etc/init.d/haproxy check
Configuration file is valid
반응형
'엔지니어 > Linux' 카테고리의 다른 글
tcp_tw_reuse와 tcp_tw_recycle (0) | 2016.07.06 |
---|---|
How to make High Available Load Balancer(L4/L7) with haproxy and Pacemaker - 1/4 (0) | 2016.07.06 |
How to make High Available Load Balancer(L4/L7) with haproxy and Pacemaker - 3/4 (0) | 2016.07.06 |
How to make High Available Load Balancer(L4/L7) with haproxy and Pacemaker - 4/4 (0) | 2016.07.06 |
Howto install GlusterFS 3.5.1 on CentOS 6.5 (1) | 2016.05.27 |