"HAProxy"의 두 판 사이의 차이
잔글 |
잔글 |
||
56번째 줄: | 56번째 줄: | ||
stats socket /var/lib/haproxy/stats | stats socket /var/lib/haproxy/stats | ||
− | defaults #--- Default 설정<br/> mode http<br/> log global<br/> option httplog<br/> option dontlognull<br/> option http-server-close<br/> option forwardfor except 127.0.0.0/8<br/> option redispatch<br/> retries 3<br/> timeout http-request 10s<br/> timeout queue 1m<br/> timeout connect 10s<br/> timeout client 1m<br/> timeout server 1m<br/> timeout http-keep-alive 10s<br/> timeout check 10s<br/> maxconn 3000 | + | defaults #--- Default 설정<br/> mode http #--- 처리할 프로토콜 지정 (http, tcp)<br/> log global<br/> option httplog<br/> option dontlognull<br/> option http-server-close<br/> option forwardfor except 127.0.0.0/8<br/> option redispatch<br/> retries 3<br/> timeout http-request 10s<br/> timeout queue 1m<br/> timeout connect 10s<br/> timeout client 1m<br/> timeout server 1m<br/> timeout http-keep-alive 10s<br/> timeout check 10s<br/> maxconn 3000 |
frontend main *:5000 #--- 모든 IP의 5000 port 요청에 대한 처리 설정<br/> #--- 시작 url과 종료 url로 url_static를 설정 합니다.<br/> acl url_static path_beg -i /static /images /javascript /stylesheets<br/> acl url_static path_end -i .jpg .gif .png .css .js | frontend main *:5000 #--- 모든 IP의 5000 port 요청에 대한 처리 설정<br/> #--- 시작 url과 종료 url로 url_static를 설정 합니다.<br/> acl url_static path_beg -i /static /images /javascript /stylesheets<br/> acl url_static path_end -i .jpg .gif .png .css .js | ||
67번째 줄: | 67번째 줄: | ||
|} | |} | ||
− | |||
− | |||
=== Load Balance 설정 === | === Load Balance 설정 === |
2014년 9월 20일 (토) 13:30 판
LoadBalance와 Proxy 기능을 제공하는 HAProxy를 정리 합니다.
- 홈페이지 :
- 다운로드 :
- 라이선스 :
- 플랫폼 :
목차
HAProxy 개요
HAProxy는 L4 Switch, L7 Switch와 Load Balance 기능을 소프트웨어적으로 제공 한다. 초당 8만건의 트래픽을 처리 한다.
Load Balance 기술
- NAT (Network Address Translation)
- DSR (Dynamic Source Routing)
- Tunneling
Load Balance 동작 모드
- Bridge/Transparent Mode : 목적지 IP와 MAC 주소를 재설정
- Router Mode : 출발지와 목적지의 IP와 MAC 주소를 재설정
- One Arm Mode : 목적지 IP와 MAC 주소를 재설정, 응답시 IP pool의 주소를 사용
- DSR (Direct Server Return) Mode : 목적지 MAC 주소를 재설정
HAProxy 설치
CentOS에서 HAProxy를 설치 합니다.
yum install haproxy service haproxy start |
HAProxy 설정 파일
- /etc/haproxy/haproxy.cfg
HAProxy 설정
HAProxy 기본 설정
vi /etc/haproxy/haproxy.cfg
global #--- Global 설정 chroot /var/lib/haproxy stats socket /var/lib/haproxy/stats defaults #--- Default 설정 frontend main *:5000 #--- 모든 IP의 5000 port 요청에 대한 처리 설정 use_backend static if url_static #--- url_static 요청은 static backend에서 처리 합니다. backend static #--- static backend 설정 backend app #--- app backend 설정 |
Load Balance 설정
Cluster 설정
ppp