Load Balancer

Load Balancer

• Creat Your Apache Server • Create a load balancer using AWS

·

4 min read

OSI Model:-

  1. Physical Layer :- Physical Layer used transfer bit stream over wire3
  2. Data Link Layer : Defines the format of data on the network
  3. Network Layer :- Decides which physical path the data will take
  4. Transport Layer :- Transmit data using transmission protocols including TCP & UDP
  5. Session Layer :- Maintains connections and is responsible for controlling ports and sessions
  6. Presentation Layer :- Ensures that data is in usable format and is where data encryption occurs
  7. Application Layer :- Human-computer interaction layer, where applications can access the network services.

What is load balancing? :-

Elastic Load Balancing automatically distributes your incoming traffic across multiple targets, such as EC2 instances, containers, and IP addresses, in one or more Availability Zones. It monitors the health of its registered targets, and routes traffic only to the healthy targets.

Creat Your Apache Server

Create an Application Load Balancer - Elastic Load Balancing Using AWS EC2 Instance.

1) You Have To Create Two EC2 Instance For Balancing the load between them. Create An Instance And Host Apache Server.

download.png

Commands Need to Https Service:-

- $yum update -y             - For updating the Packages
- $yum install httpd         - For installing httpd service 
- $systemctl start httpd   - To start the httpd Service
- $httpd                             - In order to recheck  service is running
- $systemctl enable httpd - for the autostart httpd service (to avoid again and again start httpd service)

Step 1. Install , Start & Update httpd

download (1).png

>

download (2).png

• Because of httpd service enabled > we can access through Public ip address also.

  • Check Your Server through Public IP running or Not.

download (10).png

>

download (9).png

For checking INBOUND & OUTBOND RULE

  • INBOUND - Traffic Coming from the internet on the machine
  • OUTBOND - Send info Over the internet

download (5).png

Step 2. Setup inbound and Outbound Rules

download (7).png

>

download (3).png

>

download (4).png

Step 3. Edit Outbound Rules Also Same

>

Step 4. Check Your Appache Server Now

download (8).png

Now See OUTPUT of Public IP >> U R APACHE Server is Running On Over the Internet

Now U hosted Ur Server Successfully.

Creat load balancer using AWS

Cloud Services

  1. IAAS (Infrastructure as a Service)

(taken care by client) (Application)
(Application Runtime) (OS)

This is taken care by cloud provider (virtualization) (Physical Hardware) (NETWORKING)

  1. PAAS (Platform as a service) (Application)

All the below services are take care by cloud provider (Application Runtime) (OS) (virtualization) (Physical Hardware) (NETWORKING)

  • Elastic load balancer :- Distribute incoming traffic across multiple targets
  • Amazon RDS :– Relational databases – MySQL, Oracle, SQL Server

Three types of ELB :-

1. Classic Load Balancer :- Old generation type :- (TCP / TLS) (Not recommended)

2. Application Load Balancer

  • New generation type :- Http/https

3. Network Load Balancer

  • New Gen type :- TCP & TLS & UDP
  • Very high performance

Step 1. 1 Go to Load Balancer from Load Balancing

download (11).png

> • Click on Creat Load Balancer

• Click on Application Load balancer for >> Creat

download (12).png

>

download (13).png

>

download (14).png

> Creat New Security Group with name and HTTP for Inbound and Outbond

download (15).png

>

Step 2. Click on Creat Security Group

download (16).png

>

Step 3: After Creating Security Group > We have to add this Security in Security Group (Create Application Load Balancer) by Refreshing Security Group

download (17).png

Step 4. From the Listeners and routing Creat a Target Group

download (18).png

>

download (19).png

>

Step 5.Select the Instances which on that we have to creat Load Balancer

download (20).png

Step 6 . Click on Include Pending Below:

download (21).png

>

Again Come to 'Listeners and routing' and Add the Default Group as U have Already Created Target Group.

download (22).png

>

Step 7. Now click on Creat Load balancer

download (23).png

>

download (24).png

>

Final Stage:- When Ever we Refresh it url it will Shows Both the Server Side By Side

download (25).png

This is Our First Now >>>> Refreshed

download (26).png

ezgif.com-gif-maker (1).gif