EC2 Load balancer - Elastic Load Balancing

 

EC2 Load balancer - Elastic Load Balancing

It Is simply a software to manage the load of application.

For ex: if there are 10 web servers, we have public ip for one webservers, the traffic flow to one webserver will be balanced across the 10 webservers using load balancer.

To automatically distribute incoming web traffic across multiple ec2 instances.

Add and remove ec2 instances without changing the inflow

If one of the instance fails, AWS ELB will automatically redirect the traffic to another running instance.

If the failed instance is restored, ELB restores the traffic to that instance.

ELB is like a traffic manager, it minimizes the risk of overloading one single instance and provides continuous monitoring of the health of AWS instances.

ELB can be setup to load balance incoming application traffic across Amazon ec2 instances in a single Availability zone or multiple AZs – AZ is a data center.



The AWS Classic Load Balancer (CLB) operates at Layer 4 of the OSI model. What this means is that the load balancer routes traffic between clients and backend servers based on IP address and TCP port.

 

AWS Application Load Balancer (ALB) operates at Layer 7 of the OSI model. At Layer 7, the ELB has the ability to inspect application-level content, not just IP and port. This lets it route based on more complex rules than with the Classic Load Balancer.

 

Internal load balancer -> internal, not external, not internet facing

Response timeout –  5 sec – time out value

Health check interval –  how often it pings

Unhealth threshold –  2 consecutive time outs, it tries to access page twice

Healthy threshold -  3 ping the LB and report it as healthy as 3 times. – 3 successful pings

Exercise:

1)      Create 2 ec2 instances

2)      Install apache server on both and configure

3)      On one of the machine in /var/www/html/index.html add server1

4)      On the other machine in /var/www/html/index.html add server2

5)      Create load balancer with 2 ec2 instances

6)      Open the load balancer using the url provided, by default it points to server1, so in the web browser output we can see server1  

7)      Bring down the server1, and after some time try to access the same load balancer,

it should display server2

8)      If ec2 instance is brought up again, it should show server1 in the web browser output

 





Comments