Sunday, September 25, 2016

Net702 - Lab 9: Enabling Auto Scale to Handle Spikes and Troughs

 Auto Scaling 

Auto scaling is using for automatically create and terminate the instances according to the user needs. The autoscaling can be defined on policies, schedules, and health checks. Here we are creating an auto scaling group and checking the functionalities.

To create an auto-scaling group, go to the AWS EC2 dashboard, under Auto Scaling choose ‘Launch Configurations’
  

Here we can select the instance which we want to autoscale. I have selected my Web server.


Now we can select the type of the instance to use when the auto scaling creates an instance.


In the configuration, I have selected the web server IAM role and given a name for the configuration.


Then selected the security group same as the current web server.


In the next screen, I have given the group name and group size 2, this will always keep two instances. Then I have selected the available subnets.


Then expanded the advanced details, and select to use the load balancer, then I have selected my load balancer.

Then given a tag for the group and created the group.


After creating the auto scaling, it automatically created two instances as per the configuration.



For checking the auto scaling, I have logged in to the website and noted the IP address of the server then refreshed the web page. I have received four different IPs of four servers while I keep refreshing the web page.





Then I have terminated the two old web servers which are not in the  auto scaling group. Then it kept only two servers, as we are keeping the autoscaling instances.


I have refreshed the website again and this time, I received only two IPs.



Now I have terminated the instance which is in the autoscaling group.


This time, it automatically created a new instance. Now I have confirmed that the autoscaling is working properly.


No comments: