빽기의 코딩공부Story

L4 구축하기 본문

[NETWORK]

L4 구축하기

빽기 2025. 3. 21. 14:59

1. haproxy 설치

yum install haproxy

 

2. 컨피그 설정 추가

[root@linux ~]# vi /etc/haproxy/haproxy.cfg
# L4 로드 밸런서 설정 (포트 80으로 들어온 요청을 backend backend_servers로  전달)
frontend l4_loadbalancer
    bind *:80
    default_backend backend_servers


backend backend_servers
    balance roundrobin    # 부하 분산 방식 (라운드 로빈)
    server web1 localhost:80 check
    server web2 localhost2:80 check

3. haproxy 재 실행

systemctl restart haprox

4. 상태 확인

systemctl status haproxy

'[NETWORK]' 카테고리의 다른 글

네트워크 방화벽 확인하기 curl  (0) 2023.08.10
Comments