Auto scaling and Load Balancing using AWS

Step 1: Launch Instance with the following Settings

Image for post
Image for post

Step 2: Start the service by logging into the EC2 Machine

Image for post
Image for post

Step 3: Create AMI

Image for post
Image for post
Create Image
Image for post
Image for post
Image

Step 4: Create Classic Load Balancer

Image for post
Image for post
Classic Load Balancer
Image for post
Image for post
Assign Security Groups
Image for post
Image for post
Configure Health Check
Notes:Healthy theshold 5 sec mean if index.html is reachable then the server is healthy threshold and hit 5 times
if index.html is not reachable it shows unhealthy and hit only 2 times.
Suppose index.html is not reachable, first it will hit index.html and timeout. Pack will be dropped in 5 sec. Again it will hit index.html
and packet will drop out.
After that it will take 30 sec to re-hit
Image for post
Image for post
Load balancer Created
Image for post
Image for post
Current Instance Terminated

Step 5: Launch Configuration (Auto Scaling)

Image for post
Image for post
Configuration Name- AMI- Instance Type
Image for post
Image for post
Image for post
Image for post
Launch Configuration created successfully
Note: Next we need to create auto scaling group using the launch configuration template

Step 6: Create Auto scaling groups

Image for post
Image for post
Step-1 Choose launch template or configuration
Image for post
Image for post
Step-2 Configure settings
Image for post
Image for post
step 3 — Configure advanced options
Image for post
Image for post
step 3 — Health Checks
Image for post
Image for post
Step 4- Configure group size and scaling policies
Image for post
Image for post
Step 4 — Scaling Policies
Note: before creating auto scaling group, check that you don’t have any running instances.
Image for post
Image for post
Instance Status — Check
Image for post
Image for post
Instance Running now

Step 7: Create index.html on both servers

Image for post
Image for post
Image for post
Image for post
Text used in index.html
Image for post
Image for post
Image for post
Image for post

Written by

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store