Wednesday, October 20, 2021
In this pose we are going to implement auto scaling on our instances. Auto scaling is a feature on AWS that automatically scaled horizontally either based on metrics or the health of an instance. In this post we are going to setup auto scaling on an Application Load Balancer.
1. The first thing we have to do is setup an Auto Scaling Group under "Auto Scaling" click on "Auto Scaling Groups"
2. Click on the "Create Auto Scaling group" button
3. Give your auto scaling group a name, then click on the "Create a launch template"
4. Select Amazon Linux 2 as the image, t2.micro as the instance type, and specify the "Key pair(login)"
5. Accept the default VPIC, and expand "Advance Details" and paste the following into the "User Data" to install Apache Web Server, then click on "Create launch template"
#cloud-boothook
#!/bin/bash
#Use this for your user data (script without newlines)
# install httpd (Linux 2 version)
yum update -y
yum install -y httpd.x86_64
systemctl start httpd.service
systemctl enable httpd.service
echo "Hello world from $(hostname -f)" > /var/www/html/index.html
cd /var/www/html/
cp index.html contacts.html
6. Click on "Create Auto Scaling Group"
7. Continue creating your Auto Scaling Group, as you will see the template has been selected for you, click "Next", accept the default then click "Next"
8. Accept the default, and then select the subnets you want your instances to be created in, then click "Next"
10. For scaling policies, set a policy to scale when the CPU is 50% or more
11. Click "Next" until you see the "Review" page, then click on "Create Auto Scaling group" then click on the button.
12. If you select the Auto Scaling group and click on the "Activity" tab you will see that it is in the process of creating three instances that we specified as our desired capacity.
13. If you look at the instance you will see that three new instances have been created
14. So now we can create our load balancer to tie all of this together
15. Create an Application Load Balancer, when choosing the subnet, make sure you choose the same subnets as the ones you used for your Auto Scaling Group. If you need directions on how to create an Application Load Balancer, you can go to this post.
16. Choose the Security Group that has HTTP traffic on port 80
17. For routing create a new Target group and accept the default
18.Under "Advanced health check settings" change the "Healthy threshold" value to 3, then click "Next"19. Skip the "Register Targets" because we want the load balancer to pick up the instances that the Auto Scaling group creates, click "Next" until you see the "Create" button, click on it.
20. Go back to the Auto Scaling group page, then select the Auto Scaling group and click on the "Edit" button.
20. Under "Load balancing" select the Target group that you created in the load balancer, then click "Save"
21. Now we can test to see if the Auto Scaling work, the easiest way to test it is to terminate one of the instances. Since we specify that we desired at least 2 (the minimum), a new instance should be created automatically
If you want to test the CPU utilization metrics you can follow the instruction here to put stress on your server https://acloudxpert.com/install-stress-utility-on-amazon-linux-2/
Subscribe to:
Post Comments (Atom)
Search This Blog
Tags
Web Development
Linux
Javascript
DATA
CentOS
ASPNET
SQL Server
Cloud Computing
ASP.NET Core
ASP.NET MVC
SQL
Virtualization
AWS
Database
ADO.NET
AngularJS
C#
CSS
EC2
Iaas
System Administrator
Azure
Computer Programming
JQuery
Coding
ASP.NET MVC 5
Entity Framework Core
Web Design
Infrastructure
Networking
Visual Studio
Errors
T-SQL
Ubuntu
Stored Procedures
ACME Bank
Bootstrap
Computer Networking
Entity Framework
Load Balancer
MongoDB
NoSQL
Node.js
Oracle
VirtualBox
Container
Docker
Fedora
Java
Source Control
git
ExpressJS
MySQL
NuGet
Blogger
Blogging
Bower.js
Data Science
JSON
JavaEE
Web Api
DBMS
DevOps
HTML5
MVC
SPA
Storage
github
AJAX
Big Data
Design Pattern
Eclipse IDE
Elastic IP
GIMP
Graphics Design
Heroku
Linux Mint
Postman
R
SSL
Security
Visual Studio Code
ASP.NET MVC 4
CLI
Linux Commands
Powershell
Python
Server
Software Development
Subnets
Telerik
VPC
Windows Server 2016
angular-seed
font-awesome
log4net
servlets
tomcat
AWS CloudWatch
Active Directory
Angular
Blockchain
Collections
Compatibility
Cryptocurrency
DIgital Life
DNS
Downloads
Google Blogger
Google Chrome
Google Fonts
Hadoop
IAM
KnockoutJS
LINQ
Linux Performance
Logging
Mobile-First
Open Source
Prototype
R Programming
Responsive
Route 53
S3
SELinux
Software
Unix
View
Web Forms
WildFly
XML
cshtml
githu
Wow, impressive!!! Amazing post, I found a lot of interesting information here. I really appreciate your article. Going to read more new posts.
ReplyDeleteFind out Dream 11 predictions for today's match & fantasy cricket tips. We Provides 100% true match prediction with free fantasy tips. We cover all major cricket tournaments and matches.
Food and recipes
ReplyDeleteThank you admin for your useful information . I think your dedication is inspiring. This note is just an extension of what we all already know. We couldn’t do it without you.
Hi,
ReplyDeleteThanks for sharing this beautiful and informative article.
I have really enjoyed reading the article and of course learned several new things from your content.
I would definitely share this blog on my social media pages.
Looking forward and waiting for your new blogs
Thank you
Hi,
ReplyDeleteThanks for sharing this beautiful and informative article.
I have really enjoyed reading the article and of course learned several new things from your content.
I would definitely share this blog on my social media pages.
Looking forward and waiting for your new blogs
Thank you
Hi,
ReplyDeleteThanks for sharing this beautiful and informative article.
I have really enjoyed reading the article and of course learned several new things from your content.
I would definitely share this blog on my social media pages.
Looking forward and waiting for your new blogs
Thank you
Here you Provided really good information, really appreciate your efforts it. Properties in Udaipur and Affordable housing in Udaipur
ReplyDeletehi thanks for sharing i found something new on my blog driver booster pro key
Hi,
ReplyDeleteThanks for sharing this beautiful and informative article.
I have really enjoyed reading the article and of course learned several new things from your content.
I would definitely share this blog on my social media pages.
Looking forward and waiting for your new blogs
Thank you
Excellent article. Very interesting to read. I really love to read such a nice article. Thanks! Keep rocking.
ReplyDeletevashikaran mantra for love success Mantra to control Boyfriend vashikaran for parents world famous online astrologer Boyfriend vashikaran specialist Vashikaran expert in DelhiVashikaran for Boss vashikaran mantra for wife Pati vashikaran mantra
Bethel Home Healthcare, LLC. is licensed through the Department of Mental Health for the state of Missouri. Bethel was founded by Darlene Davis in 2017 with a vison to improve the quality of life of individuals struggling with mental health and intellectual disabilities.
ReplyDeleteHi,
ReplyDeleteThanks for sharing this beautiful and informative article.
I have really enjoyed reading the article and of course learned several new things from your content.
I would definitely share this blog on my social media pages.
Looking forward and waiting for your new blogs
Thank you
Didn't know this was even possible, thanks for sharing.
ReplyDeletebuy logo
Such a detailed article. Everyone must learn AWS skills now a days! Thanks for Sharing. Style Us
ReplyDeleteWe are a team of professionals that are very keen on providing honest reviews about gaming laptops and accessories. We are working our best to make your purchase long-lasting and reliable. All the reviews on our site are totally genuine and neutral, we never favored any brand or product by our own will. All the reviews are based on deep research and analysis. Visit our website to learn more!
ReplyDeletebest bizz is the UK most trusted website which provide list of leading businesses in the UK.Improvement agency, assisting with growing your business to be more profitable, sustainable and successful.. Visit our website to learn more!
ReplyDeleteI have really enjoyed reading the article and of course learned several new things from your content.
ReplyDeleteI have really enjoyed reading the article and of course learned several new things from your content.
ReplyDeleteThanks for sharing this helpful post
We have a group of master cleaners to play out the best assignment of cleaning the carpets in the most ideal manner and get the ideal result by our cleaning interaction. Master Carpet Cleaning is one of the most recommended companies across Australia thanks to its years of experience and expertise. Our primary goal is to ensure that all our clients are beyond satisfied with our cleaning services.
ReplyDeletePro Sofa Clean is one of the most professional sofa and couch cleaning companies in Sydney. We aim to extend the life of your old domestic, office and commercial sofa or couch by cleaning it to look and feel good as new. Visit our website to learn more!
ReplyDeleteSame Day Sofa Cleaning Wollongong Experts. Doorstep Couch Cleaning Wollongong Service Today. Upholstery Cleaning experts available any day.
ReplyDeleteAt Pro Sofa Clean, we know how important it is to make sure your sofa gets properly cleaned, which is why we send our expert cleaners to handle sofa cleaning Punchbowl and all surrounding areas with the utmost care and attention to detail.
ReplyDeleteFind here Sofa Cleaning Hornsby, Upholstery Couch Steam Cleaning Services in Hornsby Sydney. Pro Sofa Clean offers solid Couch and Sofa Cleaning Services in Hornsby. Book now Same day Upholstery Couch Steam Cleaning.
ReplyDeleteProfessional Couch Cleaning Annandale Experts. Doorstep Upholstery Cleaning Annandale. Call Now for Sofa Cleaning Annandale.
ReplyDeleteLooking for Sofa Cleaning Hurstville? Doorstep Sofa Cleaning Hurstville NSW Available Today. Same Day Couch Cleaning Hurstville. Call us Upholstery Cleaning Hurstville.
ReplyDelete