A load balancer serves as the single point of contact for clients. The load balancer distributes incoming application traffic across multiple targets, such as EC2 instances, in multiple Availability Zones.
To Learn more About https://thinkcloudly.com/
Including Mental Health Support in Project Delivery, 14 May.pdf
AWS Application Load balancer
1. AWS Application Load Balancer
(ALB)
Application Load Balancer (ALB) is one of the most versatile and effective services in
AWS. This article will cover how to use it for different purposes, including dealing with
a large number of requests that can overwhelm a single machine, distributing traffic
across multiple servers, and providing redundancy when using multiple EC2 instances.
The blog post intro paragraph can be improved by adding more information about what
the reader will learn from reading this blog post.
What is Application Load Balancer (ALB)?
An Application Load Balancer (ALB) is a fully managed service that enables customers
to distribute traffic across multiple EC2 instances, HTTP services, or both. ALBs are
deployed within your VPC and can be used with Elastic Load Balancing Classic Target
Groups or the new Amazon CloudWatch-based Target Group configuration feature
introduced in 2014.
An application load balancer (ALB) is a type of network equipment used for distributing
web requests among different servers such as those running on an elastic beanstalk
environment which allows you to use microservices architecture using clusters stored
inside AWScloudwatch.
Benefits of Application Load Balancer Benefits (ALB)
1. You can add multiple ports to an EC2 instance so you don’t have to use a port
for each service.
2. Load balancers allow you to route traffic to multiple servers in different
availability zones. They work by selecting the most efficient server from a list of
available targets, and then forwarding requests towards that target via IP address
or Amazon EC2 instances.
3. You can see data about your application's performance in real-time, making it
easier to identify and fix issues that are affecting the user experience.
4. With the flexibility to change, you can route more applications in one instance.
Additionally, grouping target apps allows inter-app communication in
microservices easier than ever before and is useful for a simpler architecture.
5. ALB is a more secure service because it uses SSL/TLS certificates, user
authentication, and logging combined with the Amazon Virtual Private Cloud.
We will now create a load balancer for the application
o Login to AWS management console.
o Click on EC2 service and scroll down to the load balancers section on the
left-hand side.
2.
o Click on Create Load Balancer
o Click on Create Application Load balancer
o Give it a name as “DemoALB” and scroll down and select all the
Availability Zones which are given there
o Leave all the settings as it is and click on Next
3.
o Create a new security group if you have not created it before
o Here a new security group is created and given a name as “my-first-load-
balancer-sg” and in Type select HTTP and select Source as Anywhere
o Click on Next
o In this section give your Target group name as “my-first-target-group”
o Scroll Down and click on Advanced Health check settings
o Configure the settings as shown below figure and click on Next
4.
o In the Register targets section, you will see EC2 instances if you had
created them earlier
o If instances are not created, create them quickly by using Amazon
Linux2 AMI and launch them.
o Here I had already created instances so I will select both of them and click
on Add to register.
o Click on Create
o Wait for ALB to come to Active state from Provisioning
5.
o Now copy the DNS name and paste it in New Tab and you will see a
“Hello World” message
o We can have multiple listeners which can redirect to multiple target
groups
o Here we have one listener which is forwarding to my-first-target-group
o We will create another Target group
6. o Click on Create target group
o Give it a name as “my-second-target-group”
o Scroll down and click on Advanced Health check settings and configure
it as shown in the below figure
7.
o Click on Next and select any instance and click on Include pending below.
o Click on Create Target Group.
o In our, ALB click on the Listeners tab
8.
o We can have multiple listeners redirecting to multiple target groups
o Here we have one listener on Port 80 which is forwarding to my-first-
target-group
o Click on View/edit rules of this listener to start leveraging other target
groups
o Click on the + symbol present above and then click on the Insert rule
o Now there are 2 conditions “IF” and “THEN”
o In IF- Click on Add condition then select Path and in value type /test
o In THEN click on Add condition and select Forward to then select my-
second-target-group
o Click on Save
9.
o So, we have 2 rules, first one is evaluated as a path and target is my-
second-target-group if it matches
o Else by default, it should route to my-first-target-group
o So here we can add rules and paths and show that Application Load
Balancer is way more powerful than Classic Load balancer
Congratulations!! You have created your Application load balancer, see you in the
next lab.
Conclusion:
AWS Application Load Balancer (ALB) is a feature that can be added to the Amazon
Web Services EC2 environment. This service helps distribute traffic across multiple
instances of an application or website for improved performance and availability. If
you’re looking to learn more about cloud computing technology, please check out our
blog posts. We're always happy to answer any questions you may have!