Lab 8. Using ELB to Scale Applications

Overview

In this lab you will how create a load balancer and how it will work when the traffic is heavy.

Load Balancer

Elastic Load Balancing automatically distributes incoming application traffic across multiple Amazon EC2 instances. It enables you to achieve fault tolerance in your applications, seamlessly providing the required amount of load balancing capacity needed to route application traffic.

In this Lab you will learn:

  • How to create an Elastic Load Balancer
  • How to add instances to Load Balancer
  • How to check the instances of LB and How it works when one instance is out of service.

The image shown below is the architecture for this lab.

1

To create a LB go to services> EC2 >  from the left pane select Load Balancer > Click on Create Load Balancer

Screenshot (14)

You will get 2 load balancer Options select the Classic Load Balancer at the moment we have webserver for the customers to browse the web page and app server which handle the orders at the backend.

Note: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.

Screenshot (15)

Give the LB name as DinoStoreLB, Keep the default LB configurations. Click Next to Assign a security group.

Screenshot (16)

Select your existing ‘WebRDPGroup‘ security group, Because it allows the same port in that the load balancer is going to use and thats port:80

Screenshot (17)

Click on Next. Because no security settings will be configured.

Screenshot (18)

Keep the default configuration health checks and click on Next.

Screenshot (19)

Add the 2 instances you created webserver and Webserver image.

Screenshot (20)

Give tag name as WebserverLB so you can easily identify.

Screenshot (21)

Review the configuration settings you gave and click on Create.

Screenshot (22)Screenshot (23)

Select the LB you created click on the instances tab, Check if the the 2 instances are in service, if not wait till the status shows In service.

Note: Make sure your 2 instances are running if not it will show out of service.

Screenshot (24)

Copy your LB DNS and go to browser and paste the URL and at the end give the name of your application and keep refreshing. You will notice the IPs on the left is changing each time you refresh.

Screenshot (25)Screenshot (26)

You can remove one instance from the load balancer and refresh and you will notice the IP will be the same due to the removal of the second web server.

Screenshot (27)Screenshot (28)

You can add back the 2nd server again go to instances tab and click on edit instances and you can add back your second server.

Screenshot (29)Screenshot (30)Screenshot (31)

When all the steps are done you have finished lab 8 successfully.

By the end of this lab you learned:

  • How to create an Elastic Load Balancer
  • How to add instances to Load Balancer
  • How to check the instances of LB and How it works when one instance is out of service.

Budgeting

With Elastic Load Balancing, you only pay for what you use. You are charged for each hour or partial hour your load balancer is running and for each GB of data transferred through your load balancer. You will be charged at the end of each month for your Elastic Load Balancing resources actually consumed.  $0.025 per Elastic Load Balancer-hour (or partial hour) $0.008 per GB of data processed by an Elastic Load Balancer. Price Differs from region to region.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s