tech talk: autoscaling with amazon web services
TRANSCRIPT
T3: Tuesday Tech Talk
Autoscaling with Amazon Web Services
Amazon Web Services
• a suite of cloud compu0ng services offered by Amazon • highly reliable, scalable, low-‐cost infrastructure pla>orm in
the cloud • has more than 70 services that span a wide range including
compute, storage, networking, database, analy0cs, applica0on services, deployment, management, mobile, developer tools and tools for the Internet of things
• most central and best-‐known of these services arguably include Amazon Elas0c Compute Cloud, also known as EC2, and Amazon Simple Storage Service, also known as S3
• data center loca0ons in the U.S., Europe, Brazil, Singapore, Japan, and Australia
AMAZON WEB SERVICES
Why use it?
• Low Cost – offers low, pay-‐as-‐you-‐go pricing with no up-‐front expenses or long-‐term commitments
– lets you consume only the amount of resources that you actually need; no minimum spend needed
• Agility and Instant Elas2city – instead of wai0ng weeks or months for hardware, you can instantly deploy new applica0ons, instantly scale up as your workload grows, and instantly scale down based on demand
– one virtual server or thousands, whether you need them for a few hours or 24/7, you s0ll only pay for what you use
AMAZON WEB SERVICES
Why use it?
• Open and Flexible – a language and opera0ng system agnos0c pla>orm – choose which services you use, one or several, and choose how you use them
• Secure – a secure, durable technology pla>orm with industry-‐recognized cer0fica0ons and audits: PCI DSS Level 1, ISO 27001, FISMA Moderate, FedRAMP, HIPAA, and SOC 1 and SOC 2 audit reports
– services and data centers have mul0ple layers of opera0onal and physical security to ensure the integrity and safety of data
AMAZON WEB SERVICES
Services
AMAZON WEB SERVICES
h [ p s : / /www.expeditedssl.com/aws-‐in-‐plain-‐english
Auto Scaling
• helps you ensure that you have the correct number of EC2 instances available to handle the load for your applica0on
• create collec0ons of EC2 instances, called Auto Scaling groups • specify the minimum number of instances , maximum, and
the desired capacity – minimum -‐> Auto Scaling ensures that your group never goes below this size
– maximum -‐> Auto Scaling ensures that your group never goes above this size
– desired -‐> Auto Scaling ensures that your group has this many instances at any given 0me
AMAZON WEB SERVICES
BeneGits
• Be?er fault tolerance – can detect when an instance is unhealthy, terminate it, and launch an instance to replace it
• Be?er availability – can help you ensure that your applica0on always has the right amount of capacity to handle the current traffic demands
• Be?er cost management – can dynamically increase and decrease capacity as needed. Because you pay for the EC2 instances you use, you save money by launching instances when they are actually needed and termina0ng them when they aren't needed
AMAZON WEB SERVICES
Services Needed
• EC2 – provides scalable compu0ng capacity in the Amazon Web Services (AWS) cloud
– you can launch virtual servers as you need, configure security and networking, and manage storage
ELB – automa0cally distributes incoming applica0on traffic across mul0ple Amazon EC2 instances in the cloud
Launch ConfiguraBon – template for its EC2 instances – in here you can specify informa0on such as the AMI ID, instance type, key pair, security groups
AMAZON WEB SERVICES
Services Needed
Autoscale Group – instances are organized into groups so that they can be treated as a logical unit for the purposes of scaling and management Security Groups – acts as a virtual firewall that controls the traffic for one or more instances
• S3 – storage for the Internet
• CloudWatch – monitoring service for resources, allows you to set alarms and triggers that can be used by other AWS services
AMAZON WEB SERVICES
How to autoscale using Amazon Web Services?
Incoming requests CloudWatch triggers alarm Autoscale Group scales up EC2 instances uses Launch Configuration
Base AMI
Security Group
Elastic Load Balancer
AMAZON WEB SERVICES
How to deploy application?
User Data from Launch Configuration
sets up the env properties
systemStartup.shset up the env using properties
update.shdelegates install to env specific install script
update<Env>.sh
YUI RESET, FONTS, GRIDS
Steps
1) Set up the Elas0c Load Balancer 2) Set up the Security Group
-‐ Open the necessary ports on the necessary protocols 3) Create a Base AMI
-‐ Install the necessary sodware and services S3cmd, NGinx, etc.
4) Create a Launch Configura0on -‐ Add the configura0on script in the User Data
5) Create Autoscale Group 6) Create Cloudwatch alarms
AMAZON WEB SERVICES
References
• h[ps://d36cz9buwru1[.cloudfront.net/AWS_Overview.pdf • h[ps://aws.amazon.com/about-‐aws/ • h[ps://aws.amazon.com/autoscaling/ • h[p://docs.aws.amazon.com/autoscaling/latest/userguide/
WhatIsAutoScaling.html • h[p://docs.aws.amazon.com/autoscaling/latest/userguide/
LaunchConfigura0on.html • h[p://docs.aws.amazon.com/autoscaling/latest/userguide/
AutoScalingGroup.html • h[p://docs.aws.amazon.com/autoscaling/latest/userguide/auto-‐scaling-‐
benefits.html
AMAZON WEB SERVICES
References
• h[p://docs.aws.amazon.com/AWSEC2/latest/UserGuide/concepts.html • h[p://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-‐network-‐
security.html • h[p://docs.aws.amazon.com/AmazonS3/latest/dev/Welcome.html • h[ps://aws.amazon.com/elas0cloadbalancing/ • h[ps://aws.amazon.com/cloudwatch/ • h[ps://en.wikipedia.org/wiki/Amazon_Web_Services • h[ps://www.expeditedssl.com/aws-‐in-‐plain-‐english
AMAZON WEB SERVICES