Assignment 1 – ELB Assignment
Problem Statement: You work for XYZ Corporation that uses on premise solutions and some limited number of systems. With the increase in requests in their application, the load also increases. So, to handle the load the corporation has to buy more systems almost on a regular basis. Realizing the need to cut down the expenses on systems, they decided to move their infrastructure to AWS.
Tasks To Be Performed:
- Create a Classic Load Balancer and register 3 EC2 instances with different web pages running in them.
- Migrate the Classic Load Balancer into an Application Load Balancer.
Creation of the Three EC2 Instances:
Created 3 EC2 instances with the following:
-
Security Group Attached: I attached a security group to each of the three instances that allows HTTP, HTTPS, and SSH from all sources.
-
Commands Executed on Each EC2 Instance:
# Update the package manager
sudo yum update
# Install the Apache web server
sudo yum install httpd -y
# Start the Apache web server
sudo systemctl start httpd
# Create a web page
echo "Hello from Instance1!" | sudo tee /var/www/html/index.html
# Restart the Apache web server
sudo systemctl restart httpd
Changed: "Hello from Instance[1,2,3]!"
for each instance
Creating a Classic Load Balancer:
-
Open AWS Management Console:
- I’ll log into my AWS account and go to the EC2 dashboard.
-
Start Creating the Classic Load Balancer:
- Under the
Load Balancers
section, I’ll click onCreate Load Balancer
.
- Under the
- I’ll choose
Classic Load Balancer
and hitCreate
.
- Set Up the Load Balancer:
- I’ll give it a unique name.
- I’ll ensure it’s in my desired VPC and Mappings
us-east-1a (use1-az6)
is selected since my EC2s are in Availability Zoneus-east-1a
. - Under
Listeners and routing
, I’ll ensure HTTP is set up.
- Assigning Security Groups:
- I’ll click “Next: Assign Security Groups”.
- I’ll select the security group I previously created that allows HTTP, HTTPS, and SSH.
- Configure Health Checks:
- I’ll set the Ping Protocol to HTTP, Ping Port to 80, and Ping Path to
/index.html
.
- Adding My EC2 Instances:
- I’ll click on
Add instances
. - I’ll select the three instances I set up manually.
- Finalize Creation:
- I’ll review everything and click
Create load balancer
.
When I open the browser using the DNS name of the load balancer, I see that it hits all three servers.
Migrating to an Application Load Balancer:
To migrate a Classic Load Balancer to an ALB using the migration wizard, follow these steps:
- Open the AWS Elastic Load Balancing console.
- In the left pane, click Load Balancers.
- Select the Classic Load Balancer that you want to migrate.
- Click the Migration tab.
- Click the Launch ALB Migration Wizard button.
- Follow the instructions in the wizard to migrate your Classic Load Balancer to an ALB.
Once the migration is complete, you will be able to use the ALB to load balance your traffic.