Skip to content

Latest commit

 

History

History
109 lines (94 loc) · 2.4 KB

06-lab4.md

File metadata and controls

109 lines (94 loc) · 2.4 KB

LAB PART.4 Autoscaling

  • 延伸 PART.3 加上 Autoscaling 來增減 instances
  • 用 stress.php 增加 instances 的 loading

LAB 目標

Imgur

環境概述

  • Region:Oregon (us-west-2)

  • Network

    • VPC

      • CIDR:10.128.0.0/16
    • Internet Gateways

    • Subnet

      • public-2a
        • CIDR:10.128.11.0/24
      • public-2b
        • CIDR:10.128.21.0/24
      • private-2a
        • CIDR:10.128.12.0/24
      • private-2b
        • CIDR:10.128.22.0/24
    • Internet Gateways

    • NAT Gateway

      • select public-2a
      • select public-2b
    • Route table

      • Public
        • Destination:0.0.0.0/0 , Target:igw
        • Associations 2 public subnet
      • private-2a
        • Destination:0.0.0.0/0 , Target:nat(public-2a)
        • Associations private-2a subnet
      • private-2b
        • Destination:0.0.0.0/0 , Target:nat(public-2b)
        • Associations private-2b subnet
  • EC2

    • Security Group

      • public-ssh
        • Port:22, source:MyIP
      • private-ssh
        • Port:22, source:sg-${public-ssh-id}
      • web-lb
        • Port:80, source:0.0.0.0/0
      • web-wb
        • Port:80, source:sg-${web-lb-id}
    • Instances

    • Load balancer

      • Class LB
        • Security Groups:web-lb
        • Health Check
          • Ping Protocol:HTTP
          • Ping Port:80
          • Ping Path:/host.php
          • Response Timeout:5
          • Interval:10
          • Unhealthy threshold:2
          • Healthy threshold:2
    • Auto scaling

      • Launch Configurations
        • security groups trust port 80 source anywhere
      • Auto Scaling Groups
        • select private-{2a,2b}
        • add elb
        • health check use elb (check use ec2 type)
        • add instance tag
        • Desired:2
        • Min:1
        • Max:5
        • Scaling Policies
          • scale-out
            • Whenever Maximum of CPU
            • Is >= 70%
            • Add 67% percent of group when 70%
          • scale-in
            • Whenever Maximum of CPU
            • Is <= 30%
            • remove 1 instance when 30%

clean up

  • EC2
    • ELB
    • AMI
    • AutoScaling
  • VPC
    • NAT Gateway
    • EIP