Lab 13:To configure Auto Scaling With Load Balancer
Lab 13:To configure Auto Scaling With Load Balancer
Objective:To configure Auto scaling in AWS
Topology:
Pre-Requites:
User should have AWS account ,or IAM user with EC2fullaccess
TASK:
Launch Amazon linux instance
configure web server
stop the instance
create AMI image of above instance
Configure Autoscaling launch configuration and autoscaling group
Configure Load Balancer with Auto scaling
practical steps
1. First Launch Amazon linux instance and configure webserver
2.Create AMI from this instance
To create AMI from this instance
On Ec2 Dashboard "panel
Select the instance
click on Action button
Select instance state
click stop
Click on yes stop button
select the stopped instance
Click on Action button
Select image
Click on create image button
For image name-------------->mywebing
For image description-------->webimg
Leave remaining default
Click on create image button
click on close button
verify AMI created
on the EC2 Dashboard panel
Select IMAGES
Click on AMIs
click on status is Available
3.To configure Auto scaling
On the EC2 Dashboard panel
select "Auto scaling "
click on "Launch configuration"
click on "Create launch configuration"button
Click on"Create launch Configuration"button
click on "MY AMI"
select the AMI which was created with webserver
click on select button
choose instance Type,
General purpose ,t2,micro free tier
Click on Next:Configuration Details
On create launch configuration page
Name-------------->mylaunchconf
Monitoring------->Enable check box
Click on Next:Add storage button
By default linux takes 8 Gb EBS volumn
Leave all values as default
Click on "Next :Configures security Group"button
On create Launch configuration page
Select "create a new security Group"
Click on Review
Check the summary
click on " create launch configuration"button
on"select an existing key pair or create a new key pair "page
Select " choose an existing key pair"
select a key pair ----->student
select Acknowledge check box
click on "create launch configuration"button
On "create Auto scaling Group",page ,give values as
Launch configuration ----->mylaunchconf
Group name----------------->myautoscalegrp
For Network---------------->select default
Select All subnet one by one
Click on "Next Configure scaling policies"button
On "create Auto scaling Group"page
Select "use scaling policies to adjust the capacity of this group"
Drag Down
Click on "scale the Auto scaling group using or similar scaling policies"
Select increase Group size
Click on "Add new alarm"
click on "click topic"
on"create Alarm"box,give values as
send a notification to------------------>cpuutlizationabc
with this recipents-------------------->skmarhann999@gmail.com
whenever Average of cpu utilization
is>=------->30
click on "Create Alarm "button
for take the action--------Add1
Drag down and give Decrease policy parameters
In Decrease Group wizard
Click on "Add new alarm"
select the topic "cpuutilization"
Whenever Average of cpu utilization is select "<="
Give the value -------->20
Click on "Create Alarm "button
Check the summary click on "Next :Configure Notification"
click on "Add notification"button
Check the following output
click on "next:Configure tags"
For tag key---->Name
for tag value --------->Web Autoscale
click on Review button
Check the summary
Drag Down
Drag Down
Click on "Create Auto scaling group"button
Successfully created
Click on Close button
Verification
Now go to EC2 Dashbord
Click on instance
observer that webAutosclae instance got launched
Now login to Web Autoscale instance
Run the following command to increase the load
#yum install stress
#stress --cpu --timeout 1000
verification
After 15 minutes 3 instance got loaded automatically







































Comments
Post a Comment