Vous êtes sur la page 1sur 2

Lab 9: Enabling Auto Scale to Handle Spikes and Troughs

From https://aws.amazon.com/documentation/autoscaling/: Auto Scaling is a web service designed to


launch or terminate Amazon EC2 instances automatically based on user-defined policies, schedules, and
health checks.

1. In your AWS EC2 dashboard, under Auto Scaling choose Launch Configurations (left hand side)
2. Click Create Auto Scaling Group
3. Click Create launch configuration
4. Select your DinoStoreWebServer from the My AMs section
5. t2.micro
6. Name = scale-web
7. IAM role = WebServerRole
8. Select an existing security group = WebRDPGroup
9. Click Review and Create launch configuration
10. Choose the existing key pair from the key created with your original web server.
11. Click Create launch configuration.
12. Now in Create Auto Scaling Group
13. Group name = scale-web-asg
14. Group size = start with two (2) instances
15. Network = default VPC
16. Subnet = choose both of your default subnets by clicking in the field box, one in each AZ. NB:
this allows instances to start in both.
17. In Advanced details:
18. Tick Receive traffic from Elastic Load Balancer(s)
19. Choose the ELB you just created = DinoStoreLB
20. Health Check Type = ELB
21. Click Next: Configure scaling policies
22. Keep the group at its initial size. Note that you can use scaling policies if you had criteria to scale
up or down beyond the two instances we have.
23. Configure tags. Name = ASG-WebServer, tick Tag instances
24. Create Auto Scaling Group
25. Back in your AWS EC2 dashboard, check out the:
26. Auto scaling information to watch the instances launch.
27. Instances screen, you will see two new instances being created. Notice that there are four in
total (exluding your queue server), but there are only two in your scale-web-asg auto-scaling group. You
would theoretically delete the manually created servers before/after you started up the auto scaling
group.
28. Load Balancers screen to see the status of the instances in service.
29. In your local browser, bring up the Dino Store web site (remembering to use the load balancer
URL), and regularly refresh the page. Notice the internal IP address change. How many different IPs
showed up? How many should have shown up? Patience Padawan.
30. In the AWS EC2 Instances window, terminate the two original web servers. These are the two
that are NOT in the auto scale group.
31. Keep refreshing your browser window to watch how many IP addresses show. Patience
Padawan.
32. To test the auto scaling, terminate one of the auto-scale instances and watch what happens in
both the EC2 instances window and the auto scaling groups window. Patience Padawan.
33. Keep refreshing your browser window to watch how many IP addresses show.

Vous aimerez peut-être aussi