Week 10a AcademyCloudFoundations - Module - HA
Week 10a AcademyCloudFoundations - Module - HA
Topics Activities
• Elastic Load Balancing • Elastic Load Balancing activity
• Amazon CloudWatch activity
• Amazon CloudWatch
• Amazon EC2 Auto Scaling
Lab
• Scale and Load Balance Your
Architecture
Knowledge
check
2
Module objectives
3
Module 10: Automatic Scaling and Monitoring
5
Reminder
• The idea of a number of servers also reduce the impact of a failure
• If a single powerful EC2 fails then you lose everything
• If a single EC2 fails in a cluster then the impact is reduced to the customer
6
Elastic Load Balancing
• Distributes incoming
application or network traffic
across multiple targets in a
Elastic
single Availability Zone or Load
across multiple Availability Balancing
Zones.
IP
• Scales your load balancer as addresses
Containers
traffic to your application EC2 Lambda functions
instances
changes over time.
7
Types of load balancers
8
How Elastic Load Balancing works
• With Application Load
Balancers and Network
Load Balancers, you
register targets in target AWS Cloud
Load balancer accepts
groups, and route traffic to
the target groups. Availability Zone A
incoming traffic
Availability Zone B
from clients.
• With Classic Load
Balancers, you register
instances with the load Listener checks for
Listener connection Listener
balancer.
requests.
Load balancer
Load balancer routes
performs health ✔ . traffic only to ✔ . ✔ . ✔ .
checks to monitor
health of registered
targets.
Target
X
Target healthy targets. Target Target Target
9
Load balancer monitoring
Public subnet
Public subnet
13
• Elastic Load Balancing distributes
Section 1 key incoming application or network
takeaways traffic across multiple targets in
one or more Availability Zones.
• Elastic Load Balancing supports
three types of load balancers:
• Application Load Balancer
• Network Load Balancer
• Classic Load Balancer
• ELB offers instance health
checks, security, and monitoring.
14
Module 10: Automatic Scaling and Monitoring
16
Monitoring AWS resources
To use AWS efficiently, you need insight into your AWS resources:
• How do you know when you should launch more Amazon EC2
instances?
17
Amazon CloudWatch
• Monitors –
• AWS resources
• Applications that run on AWS
• Collects and tracks –
Amazon • Standard metrics
CloudWatch • Custom metrics
• Alarms –
• Send notifications to an Amazon SNS
topic
• Perform Amazon EC2 Auto Scaling or
Amazon EC2 actions
• Events –
• Define rules to match changes in AWS
environment and route these events to
one or more target functions or streams
for processing
18
Amazon CloudWatch
• Cloudwatch is a free resource assuming you are happy with a 5
minute interval
• You can pay for 1 second monitoring with High Resolution
• The information about each resource is then stored separately
from the device which you are monitoring
• In a event of a failure we can still pull out the statistics about
the device
• In this respect you can carry out monitoring on the device
automatically as we will see or manually
• The data can be stored for 15 months but this will change
based on the level of detail you need
• Cloudwatch can also monitor your on premise solutions as well
19
Amazon CloudWatch
• Below is an example where I was working on a database and the stats
which I needed to see
• I was actually working on this database the day before these were
recovered and the database itself had been deleted
• The format of the data can be changed to your needs
• In my case a line chart was fine as I needed an overview of what was
happening
20
CloudWatch alarms
Su M T W Th F Su M T W Th F
Sa Sa
Used Provisioned
capacity capacity
(demand) 25
Amazon EC2 Auto Scaling
26
Typical weekly traffic at Amazon.com
Provisioned capacity
27
November traffic to Amazon.com
November
24 percent
28
Auto Scaling groups
Maximum
size 29
Scaling out versus scaling in
Elastic Load
Balancing
Scheduled scaling
Launch
Auto Scaling group • Scheduled actions
configuration
• AMI • VPC and subnets
• Instance type • Load balancer Dynamic scaling
• IAM role • Scaling policies
• Security groups
• EBS volumes Predictive scaling
• AWS Auto Scaling
31
Implementing dynamic scaling
Elastic Load
Balancing
CPU
utilization If average
CPU
utilization is
> 60% for 5
minutes…
Run Amazon EC2 Auto Scaling
Amazon EC2 Auto Scaling policy Amazon CloudWatch
32
AWS Auto Scaling
35
Lab 6: Scenario
AWS Cloud
Region
Availability Zone A Availability Zone B
VPC: 10.0.0.0/16 Internet Public subnet 2:
Public subnet 1: gateway 10.0.2.0/24
10.0.0.0/24
Security group
NAT
Web Server
gateway
1
Private subnet 1: Private subnet 2:
10.0.1.0/24 10.0.3.0/24
Security group Security group
RDS DB RDS DB
Primary Secondary
36
Lab 6: Tasks
37
Lab 6: Final product
AWS Cloud
Region Availability Zone A Availability Zone B
VPC: 10.0.0.0/16 Internet
Public subnet 1: gateway Public subnet 2:
10.0.0.0/24 10.0.2.0/24
Security group
NAT
gateway Application
Private subnet 1: Load Private subnet 2:
10.0.1.0/24 Balancer 10.0.3.0/24
39
Lab debrief:
Key takeaways
40
Module 10: Automatic Scaling and Monitoring
Module wrap-up
Module summary
42
Complete the knowledge check
43
Sample exam question
Which service would you use to send alerts based on Amazon CloudWatch
alarms?
44
Thank you
This work may not be reproduced or redistributed, in whole or in part, without prior written permission from Amazon Web Services, Inc. Commercial copying, lending, or
selling is prohibited. Corrections or feedback on the course, please email us at: aws-course-feedback@amazon.com. For all other questions, contact us at:
https://aws.amazon.com/contact-us/aws-training/. All trademarks are the property of their owners.