Notice
Recent Posts
Recent Comments
Link
«   2024/09   »
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
Tags
more
Archives
Today
Total
관리 메뉴

클라우드 엔지니어 꿈나무

LoadBalancer Haproxy - Rocky9 본문

Linux

LoadBalancer Haproxy - Rocky9

새싹싹이 2023. 9. 2. 09:30

LoadBalancer

1. 부하분산

1.2. 용자의 트래픽을 내부 서버로 분산(Reverse Proxy)

1.1. Forward Proxy

1.1.1. 내부 사용자의 트래픽을 proxy 서버로 전달

1.1.2. Proxy : haproxy, nginx 사용자가 접속하는 부분

<참고>

frontend : 사용자가 접속하는 부분

backend: 공급자가 접속하는 부분

 

========================================================================================

Rocky9-1: 10.0.0.11 (haproxy)

Rocky9-2: 10.0.0.12 (httpd)

Rocky9-3: 10.0.0.13 (nginx)

Rocky9-4: 10.0.0.14 (httpd)

 

 

Rocky9-1

1. haproxy 설치

yum install -y haproxy

2. 방화벽 설치

firewall-cmd -add-port=80/tcp

3. haproxy config 설정

vi /etc/haproxy/haproxy.cfg

4. haproxy 시작

sytemctl start haproxy

 

Rocky9-2

1. httpd 설치

dnf install -y httpd

2. 방화벽 설치

firewall-cmd --add-port=80/tcp

3. html 작성

vi /var/www/html/index.html

4. httpd 실행

systemctl start httpd

 

Rocky9-3

1. nginx 설치

dnf install -y nginx

2. 방화벽 설치

firewall-cmd --add-port=80/tcp

3. html 작성

vi /usr/share/nginx/html/index.html (httpd와 경로 상이)

4. nginx실행

systemctl start nginx

 

Rocky9-4

1. httpd 설치

dnf install -y httpd

2. 방화벽 설치

firewall-cmd --add-port=80/tcp

3. html 작성

vi /var/www/html/index.html

4. httpd 실행

systemctl start httpd

 

인터넷창

주소에 10.0.0.11을 입력 후 새로고침 할 때마다 각각 서버에 입력했던 내용들이 바뀌어서 나온다.