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.”

Auto scaling in aws helps out either to terminate or launch the EC2 instances depending upon the use of traffic flow between the client and producer. In this post , we are going to create Auto Scalling for our web server instance and test it how it gonna handle the spikes.

So, Finally after completing of the lab we gonna learn

  1. Creating an Autoscaling group
  2. Configuring the Launch configuration
  3. testing the new group.

So, let get started — for a better understanding of our upcoming posts check the below reference figure that explains where we are in the Amazon Services

2016-02-15 (17)

To create an Auto scalling group i just logged into my AWS console and navigated to my launch configuration link in the Services>EC2 tab.

I choose my WebServer instance from my My AMI’s section and then click next

1-12016-02-06 (113)2016-02-06 (114)

i given the configuration details according to my lab requirements they are as follows.

  • Type – t2.micro
  • Name –  Scale-web
  • IAM role – WebServerRole
  • Security group – WebRDP group
  • Choosing my existing key pair

Once i done in configuring the details. I clicked on launch configuration and my Configuration is created. In the next step i navigated to Auto Scalling link and created a new auto scaling group. In the Configure Auto Scaling group details, enter  ‘scale-web-asg’ as the Group name. The group size = start with 2 intances. Network = default VPC. Subnet = select both the default subnets by clicking in the box(as shown in screenshot below). Collapse the ‘Advance Details’, tick ‘Receive traffic from Elastic Load Balancer(s)’ and select the ELB that was previouslt created which was the ‘ShapeStoreLB’, and finally change ‘Health Check Type’ to ELB.

2016-02-06 (113)2016-02-06 (118)2016-02-06 (119)2016-02-06 (120)2016-02-06 (121)

Once my Auto Scaling group is created. I observer that they are two new instaces created in my instance list and also these two instances are automatically added to my dinostore ELB(load balancer)

2016-02-06 (123)2016-02-06 (124)

Now in the next phase, I tried to test my dinostore web app. I copied the load balancer public DNS of my DinostoreLB and pasted it in new tab and noted the internal IP it was found to be my WebServer interal IP.

2016-02-15 (13)2016-02-06 (125)

I just tested again this time by stopping two instances (WebServer and TestServer) and found that there are two new instances created again in my instance list. This feeled me crazy but looks fantastic.

2016-02-06 (127)

So , this time when i entered the url of dinsoteLB public dns, I found the server interal IP is changed this time.

2016-02-06 (128)2016-02-06 (130)

 this shows me that my Auto Scalling group is working perfect.

That’s the end of our lab. We just successfully assigned and configured an Auto Scalling group.
Thanks for viewing the post hope you liked it….. 😀 😀 😛

By this I just completed all my lab’s in AWS. I feel really fantastic and awesome as am confident that I learnt a lot from my lab1 to Lab9. Thanks for your support and feedbacks since from my first lab. Hope I follow the same spirit in completing the upcoming labs.