Integration Of AWS Auto Scaling With Classical Load Balancer: A Step-By-Step
Step 1: Log in to AWS Console: Go to the AWS Management Console and log in to your AWS account.
Step 2: Navigate to EC2 Console under elastic load balancer, Firstly Create Load Balancer
Step 3: Create Classical Load Balancer Enter Details like the load balancer name.
Step 4: Select Default VPC or you can select your own created one and at least two availability zones.
Step 5: Select Default Security Group or Either You select your own created.
Step 6: Register your instances to classical load balancer
Step 7: You can select the additional features which can associated with the load balancer
Step 8: Click on Create load balancer
Step 9: Create Auto Scaling Group, Go to auto scaling in ec2 console and click on create scaling group, then enter the name of auto scaling group and select the launch template for auto scaling
Step 10: In Choose Instance launch options, select VPC and availability zones for auto scaling group
Step 11: In load balancing, select existing load balancer name and select the classic load balancer we earlier created.
Step 12: In Configure group size and scaling, enter your desired, minimum and maximum capacity for auto scaling.
Step 13: Select other options as by default and Click on next and click on create auto scaling
Step 14: We are now successfully integrated auto scaling with classical load balancer now to verify we will test our application, copy the ip address of ec2 instance and paste it in browser.Page returned by Linux 1 Machine
Page returned by Linux 3 Machine
Note: To get the similar output like above paste the following script in user data while creating in ec2 instance
#!/bin/bash
yum install httpd -y
service httpd start
chkconfig httpd on
mkdir /var/www/html
echo ‘Hey!! this is my first website on Linux!’ > /var/www/html/index.html
How To Integrate AWS Auto Scaling With Classical Load Balancer ?
Auto Scaling is a service in Amazon Web Services (AWS) with the help of an EC2 instance that automatically changes the number of instances as per the user’s application demand. this nature of auto-scaling helps to achieve high availability for an application without any high cost.
The elasticity feature of auto-scaling allows users to scale up and down their application resources based on predefined attributes like desired capacity, minimum capacity, and maximum capacity. This ultimately helps applications manage user traffic coming to them without disturbing the overall working of the application.