| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | ||||
| 4 | 5 | 6 | 7 | 8 | 9 | 10 |
| 11 | 12 | 13 | 14 | 15 | 16 | 17 |
| 18 | 19 | 20 | 21 | 22 | 23 | 24 |
| 25 | 26 | 27 | 28 | 29 | 30 | 31 |
Tags
- Oracle 사용자명 입력
- Oracle Express Edition
- ORA-12899
- Oracle 테이블 띄어쓰기
- oracle 18c
- 무료 오라클 설치
- ora-01722
- Oracle 테이블 대소문자
- Oracle 사용자명
- Oracle 18c HR
- Orace 18c
- 서평단
- 오라클 캐릭터셋 확인
- Oracle 18c HR schema
- 오라클 캐릭터셋 변경
- 무료 오라클 데이터베이스
- 비전공자를 위한 데이터베이스 입문
- 오라클 캐릭터셋 조회
- ORA-00922
- Oracle 윈도우 설치
- Oracle 18c 설치
- 윈도우 Oracle
- oracle
- Oracle 초기 사용자
Archives
- Today
- Total
The Nirsa Way
[HAProxy] HAProxy URL based routing & load balancing (haproxy 로드밸런싱, haproxy 라우팅) 본문
APP & Server/HAProxy
[HAProxy] HAProxy URL based routing & load balancing (haproxy 로드밸런싱, haproxy 라우팅)
KoreaNirsa 2020. 5. 14. 17:07반응형
* selinux 및 firewalld를 disabled 후 진행 했습니다.
-
HAProxy URL based routing & load balancing (haproxy 로드밸런싱, haproxy 라우팅)
- haproxy 설치
yum -y install haproxy
- /etc/haproxy/haproxy.cfg 설정 파일 수정 (환경에 따라 도메인 및 routing 또는 loadbalancing으로 써있는 부분을 바꿔서 맞춰주면 됩니다.)
defaults
log global
log 127.0.0.1 local2
mode http
option httplog
option dontlognull
option http-server-close
option forwardfor except 127.0.0.0/8
option redispatch
retries 3
timeout http-request 20
timeout queue 86400
timeout connect 86400
timeout client 86400
timeout server 86400
timeout http-keep-alive 30
timeout check 20
maxconn 50000
frontend http
bind *:80
acl routing hdr(host) -i routing.nirsa.com
acl loadbalancing hdr(host) -i loadbalancing.nirsa.com
use_backend routing if routing
use_backend loadbalancing if loadbalancing
# 1. URL Based Routing
backend routing
option httpclose
option forwardfor
server routing 10.10.10.10:80
# 2. URL Based LoadBalancing
backend loadbalancing
mode http
stats enable
stats hide-version
stats uri /stats
stats realm Haproxy\ Statistics
# monitoring:monitoring은 loadbalancing.nirsa.com/stats (세션 등 모니터링 페이지)
## 도메인에 입력될 ID/PW 이므로 변경 후 사용 해야 합니다.
stats auth monitoring:monitoring
# 로드밸런싱 방식은 roundrobin으로 사용 했습니다.
balance roundrobin
option httpclose
option forwardfor
cookie LB insert
server test-01 10.10.10.20:80 check
server test-02 10.20.10.30:80 check
위와 같이 설정이 끝났다면 서비스 재시작 하고 DNS서버에 웹서버의 A레코드를 HAProxy IP로 변경 후 재대로 라우팅 및 로드밸런싱이 되는지 확인 하시면 됩니다. 참고로, haproxy의 로그는 /var/log/haproxy.log에 남겨지니 참고 하시길 바랍니다.
systemctl restart haproxy
systemctl enable haproxy
반응형