Skip to main content

Command Palette

Search for a command to run...

Establish A Load Balancer Among Two VPC's

Updated
3 min read
Establish  A  Load  Balancer  Among  Two  VPC's

Load Balancer:-

The load balancer distributes the web traffic to the available server.
OR
Load balancing refers to the efficient distribution of incoming traffic across a group of backend servers.

Types of Load Balancer:-

  1. Application Load Balancer (HTTP, HTTPS) (7th Layer of OSI Model)

  2. Network Load Balancer (TCP, UDP, TLS) (4th Layer - Transport Layer)

  3. Classic Load Balancer (HTTP, HTTPS, TCP, SSL) (4th and 7th Layer)

Step 1:- Let's try to create VPC1.

Step 2:- Now try to create two subnets for VPC1

Subnet 1:

Subnet 2:

Step 3:- Try to create Internet Gateway for VPC1

Step 4:- Add Internet Gateway and do subnet association in the VPC1 routing table.

Step 5:- Now try to create VPC2

Step 6:- create subnet for VPC1

Step 7:- Create Internet Gateway for VPC2

Step 8:- Add Internet Gateway and do subnet association in the VPC2 routing table.

Step 9:- Create a Peering connection between VPC1 and VPC2

Step 10:- Now you have to update the route table for VPC1 and VPC2

Step 11:- Now try to create 3 instances - 2 instances for VPC1(in Subnet 1 and Subnet2) and 1 instance for VPC2

Now open VPC1-server1 and server2 and VPC2-server and try to connect it through the RDP client.
Once you have connected RDP client try to install Web Server IIS in all three instances that you have created.
If you have a question that how to install Web Server IIS in the windows Operating system please follow the below steps to install it.

Server Manager --> Add Roles and Features --> Click on Next --> Select Role bases or Features based installation --> Click on Next --> Again Click on Next --> Select Web server IIS --> Click on Add Features --> Click on Next 4 times and then click on install.

Now go to the C drive --> inetpub --> wwwroot --> Delete the files which are present in wwwroot folder --> add index.html file in wwwroot folder with one message

Perform these steps in all three remote machines.

Step 12:- Now create an Application Load Balancer

Target Group:-

Out of three instances, the VPC2 instance is showing unhealthy so incoming traffic will not go through this instance and it will distribute the traffic between 2 instances only.

Now go to the Load Balancer and copy DNS Name and try to access it through a web browser.

Output:-

Once you refresh the link it will redirect it to server2 of VPC1

This is how you manage your traffic through Load Balancer.
Thank You for reading this blog.
Hope so it will give you an idea about how the Load balancer works.

More from this blog

Nilesh Ganvir

34 posts