brunch

You can make anything
by writing

C.S.Lewis

by Master Seo Jan 19. 2020

18.(미션)Azure, Load Balancer사용

1. Virtual networks  만들기

2. Private Subnet에 가상 서버 2대 생성하기

3. 리눅스 서버에  Apache  WebServer 설치와 방화벽 허용

4. load balancer  만들기.

5. Frontend IP configuration  확인하기

6. Backend pools  설정하기

7. Health probes  설정하기

8. Add load balancing rule  설정하기

9. 확인

10. 리소스 삭제



1. Virtual networks  만들기

Name:  game-vpc

10.10.0.0/22

Resource group : game 1

Subnet

Name : public

Address range

10.10.0.0/24


subnet을 public, private , db로 만든다.



2. Private Subnet에  Virtual machine  2대 생성하기

10.10.1.0/24에 만든다.


Virtual machine >  Add

Resource group : game1

Virtual machine name :  game-web01

Image : CentOS-based 7.7

Password 


> Next : Disks

Network

Subne  : Private (10.10.1.0/24 )

Public IP : None

SSH(22)는 기본으로 열려있다.

Preferred phone number :  82-10-xxxx-xxxx



game-web02  Virtual machine 생성




3. 리눅스 서버에  Apache  WebServer 설치와  Network Security group 허용


1) Serial console로 로그온 하여  apache webserver  설치


    yum install httpd -y

    /usr/sbin/httpd

    cd /var/www/html/

    vi index.html

      <h1> web02


 

2)  Network Security group에서 80, icmp 허용


(필수)

각 개별 Virtual machine의  Network Security group에서도 80 포트를 허용해야 한다.


(선택)

Network Security group을 만들고,  Subnet에 추가로 Security group을 추가로 적용할 수 있다.

All services >  Networking >  Network Security group 변경. 80, icmp 허용.

 




+ Add

80 , icmp 허용을 추가한다.








4. load balancer  만들기.


All services  >  Networking  > Load balancers

+ Add 

Resource group : game1

name : gameweb-lb

SKU :   Standard로 변경한다.     // VM 2대 이상 포함시키는데 필요                   

Public IP address name : gameweb-pub-ip-name

> Create



5. Frontend IP configuration  확인하기

=> 따로 설정할 것 없음.

load balancers >  Frontend IP configuration




6. Backend pools  설정하기

+Add

Name :  gameweb-backend-pool-name

game-web01  , game-web01   추가




참고

SKU를  Basic으로 설정할 경우 아래와 같이 메시지가 뜬다.

All of the selected Virtual machines have to be in one Availability set or only one Virtual machine can be selected

=>  one Availability set이나 only one Virtual machine 만 된다.





7. Health probes  설정하기

+ Add 

game-web-health-probe

Protocol : HTTP

5초간 2번으로 한다.




8.  Add load balancing rule  설정하기

= > agameweb-lb-rule




9. 확인


All services > Load Balancers > gameweb-lb > Metrics 

>  Health Probe Status >  Count로  health check  상태 확인




Load balancer IP로 접속해 잘되는지 확인한다.


10. 리소스 삭제


All services > All resources  > 전체 선택

yes > Delete 


Azure에서 가장 마음에 드는 부분이다.

All resource를 한번에 볼수 있고, 한번에 모두 삭제해 비용이 나오지 않게 할수 있다.




감사합니다.




매거진의 이전글 17.(미션) Azure 네트워크 구성하기(1/2)

작품 선택

키워드 선택 0 / 3 0

댓글여부

afliean
브런치는 최신 브라우저에 최적화 되어있습니다. IE chrome safari