스스로 구축하는 AWS 클라우드 인프라 - 기본편 005

1 분 소요

Auto Scaling으로 확장성 및 탄력성 구현하기

Application Load Balancer 생성

  1. EC2 서비스 선택
    1. Load Balancing > Load Balancers 선택
    2. Create Load Balancer 선택
    3. Application Load Balancer 의 Create 선택
      1. Name : lab-web-alb-asg 입력
      2. scheme : internet-facing 선택
      3. Availability Zones
        1. lab-vpc
        2. ap-northeast-2a 체크
        3. lab-web-put1-2a 선택
        4. ap-northeast-2c 체크
        5. lab-web-pub2-2c 선택
      4. Tags
        1. Key : Name
        2. Value : lab-web-alb-asg
    4. Next: Configure Security Settings 선택
    5. Next: Configure Security Groups 선택
      1. Create a new security group 선택
      2. security group name : lab-web-alb-asg 입력
        1. Source : Custom 0.0.0.0/0 입력
    6. Next: Configure Routing 선택
      1. Target group : New target group 선택
      2. Name : lab-web-alb-asg-tg 입력
    7. Next: Register Targets 선택
      1. Instances에서 EC2 선택
      2. Add to registered 선택
    8. Next: Review 선택
    9. Create 선택

Launch Configurations 설정

  1. EC2 서비스 선택
    1. Auto Scaling > Launch Configuration 선택
    2. Create launch configuration 선택
      1. Name : lab-web-lc
      2. AMI : lweb-web-0000 설정
      3. Instance type : t2.micro 선택
      4. Advanced details
        1. User data
          1. As text 선택
      5. Security groups
        1. Select an existing security group 선택
        2. lab-web-srv-sg 선택
      6. Key pair
        1. seoul-lab-web-srv 선택
      7. I acknowledge that... 체크
      8. Create launch Configuration 선택

Auto Scaling Groups 설정

  1. EC2 서비스 선택
    1. Auto Scaling > Auto Scaling Groups 선택
    2. Create Auto Scaling group 선택
      1. Name : lab-web-asg
      2. Switch to launch template 선택
      3. lab-web-lc 선택
      4. Next 선택
      5. VPC
        1. lab-vpc 선택
      6. Subnets
        1. lab-web-pri1-2a 선택
        2. lab-web-pri2-2c 선택
      7. Next 선택
      8. Enable load balancing 체크
      9. Application Load Balancer or NEtwork Load Balancer 선택
      10. Target group : lab-web-alb-asg-tg 선택
      11. Next 선택
      12. Group size - optional
        1. Desired capacity : 2
        2. Minimum capacity : 2
        3. Maximum capacity : 4
      13. Target tracking scaling policy 선택
        1. Metric type : Average CPU utilization
        2. Target value : 50
      14. Next 선택
      15. Next 선택
      16. Add tag 선택
        1. Key : Name
        2. Value : asg
      17. Next 선택
      18. Create Auto Scaling Group 선택

참고