Elastic Load Balancer (ELB)
Load balance provide fault tolerance and High availability
What we have High availability of interview questions?
>> Load balancer and auto scalability on aws
Load balancer Diagram
Types of load balancer on aws
1. Applications load Balancer:- It is for application and work on 7th layer
(applications layer) of OSI and use protocols HTTP and HTTPS for load balance
2. Network load Balancer:- It is for Network and work on 4th layer (transport layer)
of OSI and use protocols TCP ,UDP and TLS for load balance and latency for
sudden request.
3. Classic Load Blanacer / previous generation :- It is for both App and Networkand
work on 4th and 7th layer of OSI and use protocols HTTP, HTTPS,TCP and SSL .
Load Balancer Diagram for Explanation
ELB only accept request from HTTP and HTTPS other request like ping ip that will
directly communicate if they know each other but ELB is not doing this ip ping
When user search [Link] so first DNS resolve through Authority name
server
Then pass to ELB and ELB is mapped with DNS then ELB convert domain to IP after
page will display
In ELB three important things
1. Listener
2. Target Group
3. Target
Listener:- It will check requests and decide where that request will go in HTTP or
HTTPS.
And the listener is there virtually, listener is two types frontend and backend. Frontend
listener is there up side of ELB and Backend listener is there back side of ELB.
Target Group:- It is a one group of one EC2 instance. Suppose in one group 2 EC2
instance and in another group 2 EC2 instance
Target :- It is a basically EC2 instance, IP or lambda. T1 one target for Ec2 and T2
second target for Ec2.
ELB support IPV4 address only in a VPC
Cross Zone ELB is distribute the traffic by one to one EC2 instance
ELB practical
1. First create 2 EC2 instance in virginia region one create in east-1a zone and second create in
east-1b zone
First EC2 instance
[Link] - - -VPC take default on both instance.
[Link] - - -east-1a
[Link] sign public Ip - - -enable
[Link] default
[Link] - - - ELBserver1
6. Configure Security group
Create new ELBsg1 and take SSH, HTTP. HTTPS - - - source ANYWHERE
[Link] keypair
8. Launch Instance
Second EC2 instance
[Link] - - -VPC take default on both instance.
[Link] - - -east-1b
[Link] sign public Ip - - -enable
[Link] default
[Link] - - - ELBserver2
6. Configure Security group
Take exit one ELBsg1 security group SSH, HTTP. HTTPS - - - source ANYWHERE
[Link] keypair
8. Launch Instance
After Create the both Ec2 instance
Go to the Load Balancer …it is there left side colume
Click on Load balancer
Create Load Balancer
Showing three types of Load balancer
Application LB Network LB Classic LB
Click create Application LB
Configure Load balancer
Name - - - Give Name ELB—ApplicationLB
Scheme - - - internal facing tick only
IP address type - - - IPV4
Listener
Load balancer protocols load Balancer Port
HTTP 80
Configure Load Balancer
Availability Zone
VPC select default
Select east-1a
Select east-1b
Click next
Click next
Configure security group
Select exit one ELBsg1
Configure Route
Target group
Targer Group - - - New Target group ….selelct new target group
Name - - - TG1
Target type - - - tick instance
Click Next
Register Target
Here are no Ec2 instance in LB
Add to register
Select one by one Ec2 instance and click Ec2 instance
Now here both are register in LB
Click next
The showing information
Click create
Now click on LB to test LB Copy DNS name to test
For delete the ELB
Go to LB selectLB name - - delete
Got to Target select TG1- - -delete
Network Load Balancer