Application load Balancer

Application load Balancer

Application load balancer.

Our aim to achieve the below model.

Task list:-

            Create four EC2 machines with below setup.

  • Must access to port 22 and 80 in the security group.
  • Install Apache and put one sample page with the name of index.html and image/video.html in “/var/www/html” for testing.

Once all EC2 machine created then its look like.

 

Check URL for all EC2 machine.

http://3.17.177.134/       Output: – This is Feenixdv-VideoServer1

http://52.15.107.7/         Output: – This is Feenixdv-VideoServer2

http://18.224.171.135/  Output: – This is Feenixdv-Imageserver1

http://3.17.56.231           Output: – This is Feenixdv-Imageserver2

Create Target Group from AWS console

Replace Healthy.html with any working URL like “index.html”.

 

Create the same for Video

Then set Target group for FeenixImageServer using add to registered.

Register both group with EC2 machine as planned.

 

 

Same for target group: FeenixVideoServer

 

Now create a load balancer

 

Then select ALB (Application Load Balancer).

 

Configure Security Groups: – select security group to allow (80 and 22)

Review and click on create button.

In the below selection, select only one group with a load balancer. We achieve ALB using rules.

 

Cross check, load balancer associated with a right group

In the load balance section now, you can see DNS name.

Try to access this DNS in the browser.

Here we can see page server from Image server one and two (one by one). As we attached FeenixImageServer so the output comes like this.

 

Now we need to configure rules in Load Balance -> listener section.

 

Add rules.

Here I make a rule, if in URL word like “*image*” then request forwarded to “FeenixImageServer” group of a server. Add same for “*video*”.

 

Finally, we have two rules.

 

 

Now test

For image:-

 

 

For video:-

 

 

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *