Open In App

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.



What Is Load Balancing?

A Load Balancer as the name suggests balances the load coming on the application component, in cloud platforms like Amazon Web Services (AWS), it distributes incoming network traffic to multiple servers. the main goal of the load balancer is to improve the availability, scalability, and reliability of applications by fairly distributing network traffic and preventing any one server from becoming overloaded, therefore this will improve the overall application performance.

The load balancer is attached to an application in such a way that it faces firstly the network traffic so it can able to distribute it efficiently.



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

Advantages Of Auto Scaling With Classical Load Balancer

Disadvantages Of Auto Scaling With Classical Load Balancer

How To Integrate AWS Auto Scaling With Classical Load Balancer – FAQ’s

How does the Classic Load Balancer handle newly launched instances?

When Auto Scaling launches new instances, it automatically registers them with the associated Classic Load Balancer

How does the Classic Load Balancer handle terminated instances?

When Auto Scaling terminates instances, it automatically deregisters them from the associated Classic Load Balancer.

How can I monitor the performance of the Auto Scaling and Classic Load Balancer integration?

AWS CloudWatch provides various metrics and alarms for monitoring both Auto Scaling and Classic Load Balancers.

Can I use Auto Scaling with multiple Classic Load Balancers?

Yes, you can associate an Auto Scaling group with multiple Classic Load Balancers.


Article Tags :