Thursday, 15 June 2023

Create and Configure the Auto Scaling Group in EC2

 Pre-requisite:- AWS and EC2

Auto Scaling is an Amazon Web Services it allows instance scalable when the traffic increases or CPU load increases. Auto-scaling is a service monitoring all instances that are configured into the Auto Scaling group and it ensures that loads are balanced in all instances. 

Depending on the load scaling group increase the instance according to the configuration. When we create the Auto Scaling Group we configured the Desired capacity, Minimum capacity, or Maximum capacity and also configured CPU utilization. If CPU utilization increases by 60% in all instances then one more instance create and if CPU utilization decreases by 30% in all instances then terminate one Instance. These are setting totally up to us what is our requirement. If any Instance fails due to any reason then the Scaling group maintains the Desired capacity and starts another instance.

The Auto Scaling group follows Horizontal Scaling. This service is very important for us nowadays because we do not need to create new instances manually and do not require monitoring manually.

Steps to Setup the Auto Scaling Group in EC2

Step 1: Click on the All Services.

Step 2: Click on the EC2.

ec2

 

Step 3: Scroll Down and click on the Launch Templates and click on the Create launch template

launch ec2

 

Step 4: Type the Template name.

create template

 

Step 5: Select the Amazon Machine Image.

select AMI

 

Step 6: Select the Instance Type and Key pair.

select instance type

 

Step 7: Select the Security Group or Create the new one.

security group

 

Step 8: Click on the Create Launch Template.

launch instance

 

Step 9: Now you can see the template is created. Now, scroll down and click on the Auto Scaling Groups.

autoscaling

 

Step 10: Click on the Create Auto Scaling group.

create autoscaling group

 

Step 11: Type the Auto Scaling group name.

 Auto Scaling group name

 

Step 12: Select your Template.

create template

 

Step 13: Select the VPC or go with the default VPC and also select the Availability zone.

select VPC

 

Step 14: Configure the Group size and Scaling policies.

Select as per your requirement:

  • Desired: 4
  • Minimum: 4
  • Maximum: 8
configure size

 

Step 15: Select the Target tracking scaling policy.

scaling policies

 

Step 16: Click on the Create Auto Scaling Group.

 Create Auto Scaling Group

 

  • Now you can see the Auto Scaling is creating and it is also creating the desired state of the EC2 Instance
Auto Scaling is creating

 

  • We selected the Desired state equal to 4 and you can see the 4 Instance is Running
Auto Scaling is created

No comments:

Post a Comment