06 Classic Load Balancer
06 Classic Load Balancer
Steps to be followed:
#!/bin/bash
# Use this for your user data (script from top to bottom)
# install httpd (Linux 2 version)
yum update -y
yum install -y httpd
systemctl start httpd
systemctl enable httpd
echo "<h1>Welcome to AWSNetworks web-server $(hostname -f)</h1>" >
/var/www/html/index.html
2.4 Click on Launch instance.
2.5 Repeat the steps from 2.1 to 2.4 to launch the second instance.
The instances with different Availability Zones have been launched successfully.
3.1 Go to the EC2 console and click on the Load Balancers tab under Load Balancing.
3.2 Click on Create Load Balancer tab.
3.5 Select an existing security group MyHttpServer and click on Next: Configure Security
Settings.
3.6 Click on Next: Configure Health Check.
3.7 Configure Health Check with the default details as shown in the below screenshot and
click on Next: Add EC2 Instances.
EC2 Instances with different availability zones should be added.
3.8 Select both the instances and click on Next: Add Tags.
3.9 Provide a Key and Value name as per your choice and click on Review and Create.
3.10 Under Review, verify the details and click on Create.
4.1 Go to the Load Balancer CLB-Demo which is created and check for the details under the
Description tab.
4.2 Go to the Instances tab and check the status for both the instances.
Note: The status needs to be InService which means both the instances are running
successfully.
4.3 Go to the Description tab, copy the DNS name CLB-Demo-1514223846 us-east-
1.elb.amazonaws.com and paste it into a new web browser to see the deployment.
The deployment of Classic Load Balancer to an EC2 instance has been completed while the
user data script is running successfully.