Lab 16:Two instances with Application load Balancer with own VPC
- Get link
- X
- Other Apps
Refer above how to
create our own vpc
First create security group for alb and webservers
Alb –http-80-anywhere
Webserver -ssh –2-anywhere
http -80-custom-alb
security group
first create group for
alb webserver
go to EC2 dashboard
click on security group
create security group
Create webserver
security group
Now create a alb load
balancer
Go to EC2 dashboard
Create a load balancer
Select alb load balancer
Give a name to load balancer
Select availability
zones and select public subnets in two zones.
Refer above as we create
2 public subnets and private subnets
Next click on configure
security settings
Click on configure
security setting
Select existing Security
group as we create for alb security group
Then click on configure
routing
Give a name to target
group and give a path index.html
It will check for the
index.html file
Next click on Register
Targets
We will add the target
after creating the instances
Just click on next
Click on Review
Click on Create
Alb created
Now create the instance
now
Go to the Ec2 dashboard
and launch the instances
Select the amazon ami
Go with default instance
type
Click on configure
instance
Select no.of instance
two as the webservers having same type security group and all
Select your own Vpc
Next click on add
storage
Go with the default
storage
Click on tags
Next click on security
group
Click on review and
launch
Click on launch
Select the key pair
Click on launch
Now go to git bash and install the apache
Login to webserver
#ssh –I pemfile
ec2-user@ipaddress
Ip address of webserver1
Now install apache
And start the service
Start the service
Now check whether the
page is there or not
#curlhttp://localhost
If don’t want to see
page like that just do the below command
Echo”this is webserver 1”>>/var/www/html/index.html
Do the same for the
webserver2
Login to the server and
install apache
Start the service
#systemctlstart httpd
Change the page
Echo”this is
webserver2>>/var/www/html/index.html
Now check the page in browser
Go to load balancer
Select the alb load balancer and the webserver
Add the webserver and
registered
And Save
We have both pages
- Get link
- X
- Other Apps




























Comments
Post a Comment