Cloud Vendor | Amazon AWS |
Proficiency Level | Cloud Enthusiast |
Tags | EC2Load BalancerWeb Server |
Summary
In this lab, you will provision an Applicaiton Load Balancer in AWS. You will configure the Load Balancer to balance web traffic between two web servers deployed on Amazon EC2 instances.
Each exercise below builds upon the previous one. You should start each new exercise from the last step of the previous exercise unless it is explicitly written otherwise.
Learning Objectives
After completion of this lab, you will be able to:
- Provision an Application Load Balancer in AWS
- Configure the Application Load Balancer to balance web traffic between EC2 instances
Prerequisites
To complete this lab, you will need the following:
- Reliable internet connection
- A free AWS Account used to access the AWS Management Console
- You will need to create two EC2 instances following the AWS EC2 Instance With Ubuntu and NGINX Web Server lab. When creating the EC2 instances, you need to implement the changes described in the Changes in the VM Creation section below.
Changes in the VM Creation
When following the instructions for the AWS EC2 Instance With Ubuntu and NGINX Web Server lab, implement the following changes:
- In Exercise #1: Provision an EC2 Instance with Ubuntu Linux, do the following changes:
- In Step 7, select the default subnet in
us-east-2a
- In Step 9, use
computelab01-ec2-i02
for the Name of the second EC2 instance - In Step 11, select the existing security group
computelab01-ec2-sg
if it already exists
- In Step 7, select the default subnet in
- In Exercise #5: Modify the web server’s home page, do the following changes:
- In Step 4, type the following
Hello, <code>computelabadmin!</code>! I am virtual machine #01
for the first virtual machine, and
Hello again, <code>computelabadmin!</code>! I am virtual machine #02
for the second virtual machine
- In Step 4, type the following
Exercise #1: Provision an Application Load Balancer in AWS
In this exercise, you will provision an Application Load Balancer in AWS.
Steps
-
- Sign into the AWS Management Console at https://aws.amazon.com/console/ using your AWS credentials
- In the Find Services search box, type EC2, and press Enter
- Click on the Load Balancers link in the left-hand navigation
- Click on the
button
- Click on the
button under Application Load Balancer (HTTP/HTTPS)
- In Step 1: Configure Load Balancer, the Basic Configuration section, fill in the following information:
Name →networkinglab01-ec2-lb
Scheme →internet-facing
IP address type →ipv4
- In Step 1: Configure Load Balancer, the Availability Zones section, select the following:
us-east-2a
us-east-2b
us-east-2c
- In Step 1: Configure Load Balancer, expand the Tags section, and add the following tags:
Name →networkinglab01-ec2-lb
Role →web
Lab →networkinglab01
Owner →<your name>
OwnerEmail →<your email>
- Click on the
button
- Click on the
button
- In Step 3: Configure Security Groups, select the following Security Group:
computelab01-ec2-sg
- Click on the
button
- In Step 4: Configure Routing, the Target group section, fill in the following:
Target group →New target group
Name →computelab01-web-instances
Target type →Instance
Protocol →HTTP
Port →80
- Click on the
button
- In Step 5: Register Targets, the Instances section, select the following instances:
computelab01-ec2-i01
computelab01-ec2-i02
- Click on the
button
- Click on the
button
- Review the input and click on the
button
- Once the Application Load Balancer is deployed, click on the
button
- Milestone step: At this point, you have learned how to provision an Application Load Balancer in AWS. that you have an entry with the following information in your list of Application Load Balancers.
Name →networkinglab01-ec2-lb
Exercise #2: Testing an Application Load Balancer in AWS
In this exercise, you will test the Application Load Balancer that you created in AWS. You can test the Application Load Balancer by accessing its DNS name from a browser.
Steps
- Click on the
networkinglab01-ec2-lb
Application Load Balancer in the list - In the Description tab, note the DNS name
- Open a new browser window, and paste the above DNS name in the Address Bar
- Milestone step: The page shows the home page of the NGINX server on
computelab01-vm01
- Refresh the page in the browser
- Milestone step: The page shows the home page of the NGINX server on
computelab01-vm02
Note: Depending on your browser’s caching settings, you may need to refresh the page more than once to see the second home page
Last Update: October 16, 2019
You must be logged in to post a comment.