Amazon Elastic Load Balancer

Amazon Elastic Load Balancer

A load balancer distributes workloads across multiple compute resources, such as virtual servers.
ELB can handle the varying load of your application traffic in a single availability zone and cross multiple  availability zone. This service provide high availability, automatic scaling, and robust security necessary to help make your applications fault tolerant.
 
Highly available and automatically scalable
 
There are four type load balancer
a. Application load Balancer(ALB)
b. Network Load Balancer(NLB)
c. Gateway Load Balancer(CLB)
d. Classic Load Balancer(CLB)
 
Application Load Balance:- it’s load balances HTTP and HTTPS traffic.
 
Network Load Balancer:- it’s load balances TCP,UDP and TLS traffic.
 
Gateway Load Balancer (GLB):- its mostly routing traffic for third-party application.
 
There are three main component in ALB(Application Load Balancer)
  • The First component is a listener. The goal of the listener is to check for requests to define a listener the
  • port must be provided as well as the protocol

For example , since we are routing web traffic then we set up our application to use port 80.
we’d want our load balancer to listen to port 80 using the HTTP protocol.additionally, we could set up a listener for port 443 using HTTPS protocol.

  • The second component is a target group :- A target is type of backend. You want direct traffic to ,
  • such as EC2 Instances, Aws Lambda function or IP addresses.
A target group is simply just a grouping of these backend resources. Each target group needs to have a health check, which is how load balancer check  that the target is healthy that can it start accepting traffic.The ALP operates on the application layer,which is layer 7 of the OSI Model.

  • The third component is a Rules:- A rule can define how your requested to routed to your targets.Each listener has a default rule and you can optionally define additional rules.


When you use Elastic Load Balancing with your Auto Scaling group, it’s not necessary to register individual EC2 instances with the load balancer.
Instances that are launched by your Auto Scaling group are automatically registered with the load balancer. Likewise, instances that are terminated by your Auto Scaling group are automatically deregistered from the load balancer. Check out Reading 4.5 for more information. 
 
A metric alarm has the following possible states: OK – The metric or expression is within the defined threshold. ALARM – The metric or expression is outside of the defined threshold. INSUFFICIENT_DATA – The alarm has just started, the metric is not available, or not enough data is available for the metric to determine the alarm state. Read more here: https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/AlarmThatSendsEmail.html  This information can be found in the Introduction to Amazon CloudWatch video.
 
Lets create a Application Load Balancer in AWS console.
Login to




Then click on sign in to the console
   If you wanna find ELB service, you need to go to EC2 console.



















So, we will type EC2 in service search



















Then we will get above screen 

where we will go ahead and select Load balancers.


Once we are in load balancer screen will see there is no load balancer created

see the below screen Now we will click on create load Balancer





Then we will get below screen where we will choose which type of ELB we want to create.

we can see the main three type of ELB 
















We'll be using Application Load Balancer so click on create




















After that we'll get below screen

here we will chose a name call it app-elb











The next setting will asks if we want an internet-facing or internal scheme
An Internet-facing which is route request from clients over the internet to your backend servers or your targets and on other hand an internal load balancer will route a requests from client with a private IP to target with a private IP
For Example
If you had a three-tier application with web and database tier, you cloud user internal-facing load balancer to route traffic from your web tier to your app tier.
For this app we will be using and internet-facing then we will select listener, Currently the default setting is allow HTTP traffic on Port 80. If we wanted to allow or limit to HTTPS Traffic  Then we can click on  Add Listener











We will choose HTTPS and we’ll be good to go and port will be 443.













Then we will choose VPC In availability Zone then we select both availability Zone

with public Subnet Then we’ll go ahead and click next: Configure Security Settings


Then Next again now choose you security group for your load balancer.


This is where you can decide which traffic want to allow in.


Here we’ll choose a security group that allow traffic on port 80 from anywhere.

  






Click on next configure routing Here we can create target group for our backend instance we wili give it a name then leave all defaults and click on the next.


Then Click on Next: Register Targets


Here we'll be choosing which instance we want live in target group
So click on Add to registered Then i will go ahead and select both two instance i have here  click on Add to registered then Click on Next: Review















d


















































































No comments: