0% found this document useful (0 votes)
3 views

What is Load Balancing

Uploaded by

demy2014
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

What is Load Balancing

Uploaded by

demy2014
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

What is Load Balancing? 2. Network Load Balancer (NLB) — how it distributes traffic across 2.

distributes traffic across 2.1 - From the Summary Tab, specify


different applications. “Number of instances = 2.”
Load balancing is the distribution of operates at layer 4 of the OSI model
2.2 - From the Name and Tags
workloads across multiple servers to and is ideal for applications that menu, specify a name for the first
Prerequisites instance.
ensure consistent and optimal require high throughput and low
To follow along with this tutorial, you 2.3 - For the Operating
resource utilization. It is an essential latency. will need: System, select “Amazon Linux.”
 A basic understanding of 2.4 - For the AMI, select “Amazon
aspect of any large-scale and3. Classic Load Balancer (CLB) —
AWS EC2 instances. Linux 2023 AMI.”
scalable computing system, as it operates at layer 4 of the OSI model  A basic understanding of 2.5 - For the Architecture, select
AWS EBS Elastic Block “Amazon Linux.”
helps you to improve the reliability and is ideal for applications that
Storage.
and performance of your applications. require basic load balancing features.  A basic understanding of AWS Figure 3.2 - AWS ALB Application
ELB - Elastic Load Balancers. Load Balancer | Specifying the
Elastic Load Balancing:
Parameters of an EC2 Instance
How to Deploy an Application Load
Elastic Load Balancing (ELB) is a Provisioning Two EC2 Instances Step 3 - Specify Instance
Balancer (ALB)
for This Exercise Parameters [Part 2 / 4]
service provided by Amazon Web Application load balancers operate at
In order to test the application load 3.1 - From the Instance Type, specify
the 7th layer of the OSI Model.
Services (AWS) that automatically balancer, we’re going to launch two “t2.micro”
They’re used to direct the incoming
EC2 Instances. The process is 3.2 - From the Key Pair, specify
distributes incoming traffic across traffic to the correct application.
described in detail in the following “Proceed without a key pair,” or
multiple EC2 instances. ELB provides tutorial - AWS EC2 select a key-value pair you’d like to
Step 1 - From the Instances Tab in use for this exercise.
three types of load balancers: Introduction to Application Load
EC2 Dashboard, Launch Instances
Balancers (ALB)
1. Application Load Balancer (ALB) — 1.1 - From the Instances, click on Figure 3.3 - AWS ALB Application
Application load balancers operate at
“Launch Instances.” Load Balancer | Specifying the
operates at layer 7 of the OSI model the 7th layer of the OSI Model.
Parameters of an EC2 Instance
They’re used to direct the incoming
and is ideal for applications that Figure 3.1 - AWS ALB Application Step 4 - Specify Instance
traffic to the correct application and
Load Balancer | Creating a new EC2 Parameters [Part 3 / 4]
require advanced routing and thus operate on HTTP, HTTPS, and
Instance 4.1 - From the Network Settings
WebSocket protocols.
microservices. Step 2 - Specify Instance Security Groups, specify “Select
In this tutorial, we will deploy an
Parameters [Part 1 / 4] existing security group” or create a
application load balancer (ALB) in our
new one.
AWS infrastructure and demonstrate
4.2 - From the Network Settings 5.2 - From the Summary Step 2 - Create an Application The last option, which is Availability
Security Groups, specify “Select sidebar, click on “Launch Load Balancer Zones is critical as the traffic can be
existing security group” or create instance.” As we’ve covered in the main ELB - managed across them. In this
a new one. At this point, you should have two Elastic Load Balancer Guide, there example, we’re going to enable all of
4.3 - From the Configure Storage EC2 Instances within your AWS are many types of Load Balancers. them.
section, specify “gp3 - 8 GiB.” environment. By navigating to the IP However, our goal is to focus on the 3.1 - Enter a name for the load
address of each instance, you should Application Load Balancer which is balancer.
Figure 3.4 - AWS ALB Application receive a message specified within ideal for the HTTP traffic we’re 3.2 - From the Scheme, select
Load Balancer | Specifying Security the code snipped above. Note that if working with on the EC2 Instances. “Internet facing.”
Groups and Storage for the EC2 you have trouble accessing the 2.1 - From the panels, click 3.3 - From the IP address, select
Instances instances, verify that your security on “Create” for the Application Load “IPv4.”
group inbound rules have been Balancer. 3.4 - From the Availability Zone
Step 5 - Specify Instance configured correctly. section, select each one.
Parameters [Part 4 / 4] Figure 4.2 - AWS ALB Application 3.5 - At the bottom of the page, click
5.1 - From the Advanced Settings, Creating an Application Load Load Balancer | Creating a New on “Next: Configure Security
under User Data, specify the code Balancer [ALB] in AWS Application Load Balancer Settings.”
snippet posted below. At this point, we can create a load
#!/bin/bash balancer that will direct the HTTP Step 3 - Specify the Parameters for Figure 4.3 - AWS ALB Application
# Use this for your user data (script traffic to either one of the EC2 the ALB [Part 1 / 2] Load Balancer | Specifying Basic
from top to bottom) Instances we’ve created. In the first step of configuring an ALB, Settings for the ALB - Name,
# install httpd (Linux 2 version) we’ll be met with the Name, Scheme, Scheme, IP, Availability Zones
yum update -y Step 1 - Navigate to the Load IP address type, and availability Step 4 - Specify the Parameters for
yum install -y httpd Balancers Tab under the EC2 zones. The name is optional. The the ALB [Part 2 / 2]
systemctl start httpd Dashboard & Create a Load scheme will dictate if the traffic to the Security Groups will dictate which
systemctl enable httpd Balancer ALB will come from the outside or traffic is allowed and restricted in / out
echo "Hello World from $(hostname - 1.1 - From the left menu, click on within the cloud services of various services. They’re a
f)" > /var/www/html/index.html “Load Balancer.” environment. It’s important to note necessity for many infrastructure
1.2 - From the center menu, click on that ALBs can route traffic between components within AWS. In this case,
Figure 3.6 - AWS ALB Application “Create Load Balancer.” applications that live in AWS. For the we’re going to create a new Security
Load Balancer | Adding the Script into purposes of this tutorial, and since Group that allows any traffic from the
the EC2 Instance & Launching Figure 4.1 - AWS ALB Application we’d like to see our EC2 instances outside. It’s important to note that
Load Balancer | Creating a New serve up different pages, we’ll have to we’re doing this for learning purposes
Application Load Balancer set this setting to “internet facing.” only. We recommend that you
configure the Security Group settings 5.3 - For the Port setting, choose At this point, we’ve finalized the Figure 5.1 - AWS ALB Application
suitable for your organization. “80.” - This needs to match the configuration of the ALB. Spend a Load Balancer | Validating Application
4.1 - At the Assign a security group port of the instances. moment to verify the settings. Load Balancer in AWS
setting, click on “Create a new 5.4 - For the Protocol Version 7.1 - At the bottom of the page, click
security group.” setting, choose “HTTP.” on “Create.” Step 2 - Validate ALB Targets
4.2 - For the rule setting, choose 5.5 - At the bottom of the page, click 2.1 - From the Left Sidebar, select
HTTP as Type, TCP as Protocol, 80 on “Next: Register Settings.” Figure 4.7 - AWS ALB Application “Target Groups.”
as Port Range, 0.0.0.0 ../0 as Load Balancer | Validating 2.2 - From the Target Group
Source. Figure 4.5 - AWS ALB Application ALB Settings list, select the target group we
4.3 - At the bottom of the page, click Load Balancer | Configuring a Target Validating an Application Load specified during the ALB creation
on “Next: Configure Routing.” Group for the ALB Balancer [ALB] in AWS process.
The ALB we’ve created in the 2.3 - From the Targets tab, view the
Figure 4.4 - AWS ALB Application Step 6 - Adding Instances to the previous steps should now be instances and validate that they’re
Load Balancer | Configuring a New Target Group starting. It can take anywhere labeled as “healthy.”
Security Group for the ALB The target group has been specified, between 30 seconds and a few
but hasn’t had any members added to minutes for the ALB to become Figure 5.2 - AWS ALB Application
Step 5 - Specify the Target Group it. If you’ve done everything correctly “Active.” Before then, you’ll probably Load Balancer | Validating Application
The target group is what contains the in the earlier steps of this tutorial, you see unexpected results wily trying to Load Balancer EC2 Instance in AWS
instances, or other assets / should be able to select the instances validate the functionality of the
infrastructure that will be serviced we had created and add them to the service.
traffic from the ALB. In this section, target groups we’ve just specified.
we’re going to create a new target 6.1 - Select both instances. Step 1 - Navigate to the Load
group that will contain the two EC2 6.2 - Above the selection are, click Balancers Tab under the EC2
instances we’ve created before. Note on “Add to registered.” Dashboard & Create a Load
that you’ll need to create separate 6.3 - At the bottom of the page, click Balancer
target groups and assign them to the on “Next: Review.” 1.1 - From the Load Balancers
ALB if you wish to incorporate tab, select the load balancer we
different ressources - Ex: Instances Figure 4.6 - AWS ALB Application just created.
and Lambda Functions. Load Balancer | Configuring 1.2 - From the Description tab, copy
5.1 - Enter a name for the Target Registered Targets for the ALB the DNS name.
Group.
5.2 - For the Target Type Step 7 - Validate all settings /
setting, choose “Instance.” configs & create

You might also like