SlideShare a Scribd company logo
Study Group: AWS SAA Guide
Chapter 03 -
Elasticity and Scalability Concepts
Aki Yu
2020.Apr
● AWS Certified Solutions Architect - Associate Guide
https://www.amazon.com/AWS-Certified-Solutions-Architect-certification/dp/1789130662/
● Google Books 上可讀到前3章:
https://books.google.com.tw/books?id=P-l1DwAAQBAJ
● PacktPub 與 Oreilly 各有 10 Days Free Trial 可看書的完整內容:
https://www.packtpub.com/virtualization-and-cloud/aws-certified-solution-architect-associate-guide
https://www.oreilly.com/library/view/aws-certified-solutions/9781789130669/
● 本書 Github Source Code:
https://github.com/PacktPublishing/AWS-Certified-Solutions-Architect-Associate-Guide
https://github.com/gabanox/Certified-Solution-Architect-Associate-Guide
Book: AWS SAA Guide
Ch3 Elasticity and Scalability Concepts
• Technical requirements
• Sources of failure
• Dividing and conquering
• Virtualization
technologies
• LAMP installation
• Scaling the web server
• Resiliency
• EC2 persistence model
• Disaster recovery
• Cascading deletion
• Bootstrapping
• Scaling the compute
layer
• Scaling a database
server
• Summary
• Further reading
Ch3 Elasticity and Scalability Concepts
AWS Command Line Interface
https://aws.amazon.com/cli/
• Technical requirements
• Sources of failure (S3)
1. No, you're not crazy. Part of the internet broke
2. How a typo took down S3, the backbone of the internet
3. Amazon S3 Outage Has Broken a Large Chunk of the Internet
Root Cause - Typo
Failure should be our teacher;
as Thomas A. Edison said, "I have not failed. I've just found 10,000 ways that won't work."
• Dividing and conquering (分而治之)
Recovery Oriented Computing (ROC)
如果您有一個複雜的問題,請將其分解為各個易於管理的部分;
隔離它們,並專注於避免失敗的獨特策略。
• Serial configuration RDS
EBS
• Parallel configuration
• Active-Active (AA)
• High Availability (HA)
Warm Standby, Hot Standby, Cold
• Reactive and proactive scalability
Horizontal scalability
To avoid single points of failure (SPOFs)
Vertical scalability
加ram 加cpu 舉例來說 Elastic Compute Cloud (EC2) has different instance types, families, and sizes, which allows
for the vertical scalability of a single compute node, as shown in the following screenshot:
LAMP
• Exercise
• Virtualization technologies
aws ec2 run-instances --image-id {ami-14c5486b}—key-name {BookShelfApp }
NETWORK & SECURITY | Security Groups
CLIENT_IP=$(curl -s http://checkip.amazonaws.com)"/32"
aws ec2 authorize-security-group-ingress --group-name default --protocol tcp --port 22 --cidr $CLIENT_IP
LAMP installation
sudo yum update -y
sudo yum install -y httpd24 php70 mysql56-server php70-mysqlnd sudo usermod -a -G apache ec2-user
sudo chown -R ec2-user:apache /var/www
sudo chmod 2775 /var/www
find /var/www -type d -exec sudo chmod 2775 {} ;
find /var/www -type f -exec sudo chmod 0664 {} ;
echo "<?php phpinfo(); ?>" > /var/www/html/phpinfo.php
aws ec2 authorize-security-group-ingress --group-id {sg-bddd92cb} --protocol tcp --port 80 --cidr 0.0.0.0/0
Scaling the web server
1. Obtain the instance-id with the following expression:
export CURRENT_INSTANCE=$(aws ec2 describe-instances --query 'Reservations[*].Instances[*].InstanceId' --filters
'Name=instance- state-name,Values=running' --output text)
2. We must stop the instance to change the instance-type attribute to m4.large, as follows:
aws ec2 stop-instances --instance-id $CURRENT_INSTANCE --output json
3. Once stopped, modify the attribute via the CLI, as follows:
aws ec2 modify-instance-attribute --instance-id $CURRENT_INSTANCE - -instance-type m4.large
4. Restart the instance, as follows:
aws ec2 start-instances --instance-id $CURRENT_INSTANCE --output json
Resiliency
CURRENT_INSTANCE=$(aws ec2 describe-instances --query 'Reservations[*].Instances[*].InstanceId' --filter
'Name=tag:Name,Values=WebServer' --output text)
aws ec2 reboot-instances --instance-ids $CURRENT_INSTANCE
aws ec2 stop-instances --instance-id $CURRENT_INSTANCE
aws ec2 start-instances --instance-id $CURRENT_INSTANCE
aws ec2 allocate-address --domain vpc
IP 會跑掉,所以做一個 ip先
aws ec2 associate-address --allocation-id {eipalloc-d300d8db} --instance-id $CURRENT_INSTANCE
./lsblk 列出 Block Device
EC2 persistence model
Xen hypervisors using HVM virtualization.
Every EC2 instance has private access to a DNS metadata server within the VPC at the 169.254.169.254 canonical address.
metadata server can be used to read information about the instance itself, along with the surrounding infrastructure in which it is running.
This is valuable when you are writing bootstrapping scripts, applying application configurations, and even performing service
authentication techniques.
With a simple curl command, we can access the block-device-mapping information from this image.
Direct Attached Storage (DAS) / Network Attached Storage (NAS)
aws ec2 stop-instances --instance-id $CURRENT_INSTANCE
aws ec2 detach-volume --volume-id {vol-0cae081b840a5d91e}
aws ec2 attach-volume --volume-id vol-0cae081b840a5d91e --instance-id
aws ec2 start-instances --instance-id $CURRENT_INSTANCE --output json
Our file no longer exists.
Direct Attached Storage (DAS) / Network Attached Storage (NAS)
1. To properly associate the volume, let's query the AZ in which this instance is currently running, as follows:
aws ec2 describe-instances --instance-ids $CURRENT_INSTANCE -- output json --query
'Reservations[0].Instances[0].Placement'
The result is as follows:
{
"Tenancy": "default", "GroupName": "", "AvailabilityZone": "us-east-1a"
}
2. Create the volume by using the AvailabilityZone information, as follows:
aws ec2 create-volume 
--size 80 
--availability-zone $(aws ec2 describe-instances --instance-ids $CURRENT_INSTANCE --query
'Reservations[0].Instances[0].Placement.AvailabilityZone' --filter 'Name=tag:Name,Values=WebServer' --output
text) 
--volume-type gp2
3. Now, describe the volumes that are available in order to find the status information, as follows:
aws ec2 describe-volumes
aws ec2 attach-volume --volume-id $(aws ec2 describe-volumes
-- query 'Volumes[0].VolumeId' --output text)
--instance-id $CURRENT_INSTANCE --device /dev/xvda
sudo mkfs -t ext4 /dev/xvdb
sudo mkdir /data
sudo mount /dev/xvdb /data
vi /etc/fstab
Cascading deletion
aws ec2 create-snapshot --volume-id vol-080c266f654bca621 -- description "Data volume first snapshot"
aws ec2 describe-snapshots --owner-ids self
aws ec2 delete-volume --volume-id vol-080c266f654bca621
Bootstrapping cloud-init
1. We will provision our new instance by using the following user data input file. You can find this file in the GitHub repository under
chapter02/bootstrap.txt:
aws ec2 run-instances --image-id ami-14c5486b --key-name BookShelfApp --instance-type t2.medium --security-group-ids sg-
bddd92cb --user-data file://bootstrap.txt
2. Refresh the current instance variable, as follows:
export CURRENT_INSTANCE=$(aws ec2 describe-instances --query 'Reservations[*].Instances[*].InstanceId' --filters
'Name=instance- state-name,Values=running' --output text)
3. Now, associate the Elastic IP as follows:
aws ec2 associate-address --allocation-id eipalloc-d300d8db -- instance-id $CURRENT_INSTANCE
4. Navigate to your Elastic IP address by using your web browser (in my case,
it's 52.44.105.242); we can now validate that our web server was created from scratch, as shown in the following screenshot:
Scaling the compute layer
aws ec2 run-instances --image-id ami-14c5486b --key-name BookShelfApp
--instance-type t2.large
--security-group-ids sg- bddd92cb
--user-data file://bootstrap.txt
aws ec2 associate-address --instance-id i-096a8c337e10e9edf -- allocation-id eipalloc-d300d8db
Proactive scalability
Scaling a database server
Create Read Replica
名詞說明
• SRA 計算
serial configuration / parallel configuration
• fstab 開機自動掛載
• Floating IP cloud pattern
● S3 - Simple Storage Service
● RDS - Rational Database Service
● EBS - Elastic Block Store
一般用途 SSD (gp2) 磁碟區 0.10 USD 佈建儲存每月每 GB
佈建 IOPS SSD (io1) 磁碟區 0.125 USD 佈建儲存每月每 GB和 0.065 USD 每月每個佈建 IOPS
輸送量優化 HDD (st1) 磁碟區 0.045 USD 佈建儲存每月每 GB
冷 HDD (sc1) 磁碟區 0.025 USD 佈建儲存每月每 GB
磁帶
● HA● AA
● EC2 - Elastic Compute Cloud
● AMI - Amazon Machine Image
● LAMP - Linux、Apache、MySQL、PHP
● PV - ParaVirtualization
● HVM - Hardware Virtual Machine
● Xen hypervisor

More Related Content

What's hot

(SEC323) New: Securing Web Applications with AWS WAF
(SEC323) New: Securing Web Applications with AWS WAF(SEC323) New: Securing Web Applications with AWS WAF
(SEC323) New: Securing Web Applications with AWS WAF
Amazon Web Services
 
Building serverless enterprise applications - SRV315 - Toronto AWS Summit
Building serverless enterprise applications - SRV315 - Toronto AWS SummitBuilding serverless enterprise applications - SRV315 - Toronto AWS Summit
Building serverless enterprise applications - SRV315 - Toronto AWS Summit
Amazon Web Services
 
Handson Lab Log Analytics
Handson Lab Log AnalyticsHandson Lab Log Analytics
Handson Lab Log Analytics
Amazon Web Services
 
(SEC315) NEW LAUNCH: Get Deep Visibility into Resource Configurations | AWS r...
(SEC315) NEW LAUNCH: Get Deep Visibility into Resource Configurations | AWS r...(SEC315) NEW LAUNCH: Get Deep Visibility into Resource Configurations | AWS r...
(SEC315) NEW LAUNCH: Get Deep Visibility into Resource Configurations | AWS r...
Amazon Web Services
 
Introduction to Virtual Kubelet
Introduction to Virtual KubeletIntroduction to Virtual Kubelet
Introduction to Virtual Kubelet
Mitchell Pronschinske
 
Best Practices and Hard Lessons of Serverless- AWS Startup Day Toronto- Diego...
Best Practices and Hard Lessons of Serverless- AWS Startup Day Toronto- Diego...Best Practices and Hard Lessons of Serverless- AWS Startup Day Toronto- Diego...
Best Practices and Hard Lessons of Serverless- AWS Startup Day Toronto- Diego...
Amazon Web Services
 
Deep Learning for Developers (Advanced Workshop)
Deep Learning for Developers (Advanced Workshop)Deep Learning for Developers (Advanced Workshop)
Deep Learning for Developers (Advanced Workshop)
Amazon Web Services
 
High Performance Web Pages - 20 new best practices
High Performance Web Pages - 20 new best practicesHigh Performance Web Pages - 20 new best practices
High Performance Web Pages - 20 new best practices
Stoyan Stefanov
 
Rocking the enterprise with Ruby - RubyKaigi 2010
Rocking the enterprise with Ruby - RubyKaigi 2010Rocking the enterprise with Ruby - RubyKaigi 2010
Rocking the enterprise with Ruby - RubyKaigi 2010
releasebeta
 
Amazon web services quick guide - tutorialspoint
Amazon web services   quick guide - tutorialspointAmazon web services   quick guide - tutorialspoint
Amazon web services quick guide - tutorialspoint
Vishnu Sure
 
Smart networking with service meshes
Smart networking with service meshes  Smart networking with service meshes
Smart networking with service meshes
Mitchell Pronschinske
 
(SEC401) Encryption Key Storage with AWS KMS at Okta
(SEC401) Encryption Key Storage with AWS KMS at Okta(SEC401) Encryption Key Storage with AWS KMS at Okta
(SEC401) Encryption Key Storage with AWS KMS at Okta
Amazon Web Services
 
Zero to Sixty: AWS CloudFormation (DMG201) | AWS re:Invent 2013
Zero to Sixty: AWS CloudFormation (DMG201) | AWS re:Invent 2013Zero to Sixty: AWS CloudFormation (DMG201) | AWS re:Invent 2013
Zero to Sixty: AWS CloudFormation (DMG201) | AWS re:Invent 2013
Amazon Web Services
 
Cloud Security At Netflix, October 2013
Cloud Security At Netflix, October 2013Cloud Security At Netflix, October 2013
Cloud Security At Netflix, October 2013
Jay Zarfoss
 
How to implement data encryption at rest in compliance with enterprise requir...
How to implement data encryption at rest in compliance with enterprise requir...How to implement data encryption at rest in compliance with enterprise requir...
How to implement data encryption at rest in compliance with enterprise requir...
Steffen Mazanek
 
Stack Mastery: Create and Optimize Advanced AWS CloudFormation Templates - DE...
Stack Mastery: Create and Optimize Advanced AWS CloudFormation Templates - DE...Stack Mastery: Create and Optimize Advanced AWS CloudFormation Templates - DE...
Stack Mastery: Create and Optimize Advanced AWS CloudFormation Templates - DE...
Amazon Web Services
 
Cloud Security @ Netflix
Cloud Security @ NetflixCloud Security @ Netflix
Cloud Security @ Netflix
Jason Chan
 
(SEC305) How to Become an IAM Policy Ninja in 60 Minutes or Less
(SEC305) How to Become an IAM Policy Ninja in 60 Minutes or Less(SEC305) How to Become an IAM Policy Ninja in 60 Minutes or Less
(SEC305) How to Become an IAM Policy Ninja in 60 Minutes or Less
Amazon Web Services
 
(SEC306) Defending Against DDoS Attacks
(SEC306) Defending Against DDoS Attacks(SEC306) Defending Against DDoS Attacks
(SEC306) Defending Against DDoS Attacks
Amazon Web Services
 
Compliance in the Cloud Using Security by Design
Compliance in the Cloud Using Security by DesignCompliance in the Cloud Using Security by Design
Compliance in the Cloud Using Security by Design
Amazon Web Services
 

What's hot (20)

(SEC323) New: Securing Web Applications with AWS WAF
(SEC323) New: Securing Web Applications with AWS WAF(SEC323) New: Securing Web Applications with AWS WAF
(SEC323) New: Securing Web Applications with AWS WAF
 
Building serverless enterprise applications - SRV315 - Toronto AWS Summit
Building serverless enterprise applications - SRV315 - Toronto AWS SummitBuilding serverless enterprise applications - SRV315 - Toronto AWS Summit
Building serverless enterprise applications - SRV315 - Toronto AWS Summit
 
Handson Lab Log Analytics
Handson Lab Log AnalyticsHandson Lab Log Analytics
Handson Lab Log Analytics
 
(SEC315) NEW LAUNCH: Get Deep Visibility into Resource Configurations | AWS r...
(SEC315) NEW LAUNCH: Get Deep Visibility into Resource Configurations | AWS r...(SEC315) NEW LAUNCH: Get Deep Visibility into Resource Configurations | AWS r...
(SEC315) NEW LAUNCH: Get Deep Visibility into Resource Configurations | AWS r...
 
Introduction to Virtual Kubelet
Introduction to Virtual KubeletIntroduction to Virtual Kubelet
Introduction to Virtual Kubelet
 
Best Practices and Hard Lessons of Serverless- AWS Startup Day Toronto- Diego...
Best Practices and Hard Lessons of Serverless- AWS Startup Day Toronto- Diego...Best Practices and Hard Lessons of Serverless- AWS Startup Day Toronto- Diego...
Best Practices and Hard Lessons of Serverless- AWS Startup Day Toronto- Diego...
 
Deep Learning for Developers (Advanced Workshop)
Deep Learning for Developers (Advanced Workshop)Deep Learning for Developers (Advanced Workshop)
Deep Learning for Developers (Advanced Workshop)
 
High Performance Web Pages - 20 new best practices
High Performance Web Pages - 20 new best practicesHigh Performance Web Pages - 20 new best practices
High Performance Web Pages - 20 new best practices
 
Rocking the enterprise with Ruby - RubyKaigi 2010
Rocking the enterprise with Ruby - RubyKaigi 2010Rocking the enterprise with Ruby - RubyKaigi 2010
Rocking the enterprise with Ruby - RubyKaigi 2010
 
Amazon web services quick guide - tutorialspoint
Amazon web services   quick guide - tutorialspointAmazon web services   quick guide - tutorialspoint
Amazon web services quick guide - tutorialspoint
 
Smart networking with service meshes
Smart networking with service meshes  Smart networking with service meshes
Smart networking with service meshes
 
(SEC401) Encryption Key Storage with AWS KMS at Okta
(SEC401) Encryption Key Storage with AWS KMS at Okta(SEC401) Encryption Key Storage with AWS KMS at Okta
(SEC401) Encryption Key Storage with AWS KMS at Okta
 
Zero to Sixty: AWS CloudFormation (DMG201) | AWS re:Invent 2013
Zero to Sixty: AWS CloudFormation (DMG201) | AWS re:Invent 2013Zero to Sixty: AWS CloudFormation (DMG201) | AWS re:Invent 2013
Zero to Sixty: AWS CloudFormation (DMG201) | AWS re:Invent 2013
 
Cloud Security At Netflix, October 2013
Cloud Security At Netflix, October 2013Cloud Security At Netflix, October 2013
Cloud Security At Netflix, October 2013
 
How to implement data encryption at rest in compliance with enterprise requir...
How to implement data encryption at rest in compliance with enterprise requir...How to implement data encryption at rest in compliance with enterprise requir...
How to implement data encryption at rest in compliance with enterprise requir...
 
Stack Mastery: Create and Optimize Advanced AWS CloudFormation Templates - DE...
Stack Mastery: Create and Optimize Advanced AWS CloudFormation Templates - DE...Stack Mastery: Create and Optimize Advanced AWS CloudFormation Templates - DE...
Stack Mastery: Create and Optimize Advanced AWS CloudFormation Templates - DE...
 
Cloud Security @ Netflix
Cloud Security @ NetflixCloud Security @ Netflix
Cloud Security @ Netflix
 
(SEC305) How to Become an IAM Policy Ninja in 60 Minutes or Less
(SEC305) How to Become an IAM Policy Ninja in 60 Minutes or Less(SEC305) How to Become an IAM Policy Ninja in 60 Minutes or Less
(SEC305) How to Become an IAM Policy Ninja in 60 Minutes or Less
 
(SEC306) Defending Against DDoS Attacks
(SEC306) Defending Against DDoS Attacks(SEC306) Defending Against DDoS Attacks
(SEC306) Defending Against DDoS Attacks
 
Compliance in the Cloud Using Security by Design
Compliance in the Cloud Using Security by DesignCompliance in the Cloud Using Security by Design
Compliance in the Cloud Using Security by Design
 

Similar to AWS Study Group - Chapter 03 - Elasticity and Scalability Concepts [Solution Architect Associate Guide]

My First Big Data Application
My First Big Data ApplicationMy First Big Data Application
My First Big Data Application
Amazon Web Services
 
AWS Pentest.pdf
AWS Pentest.pdfAWS Pentest.pdf
AWS Pentest.pdf
MAHESHUMANATHGOPALAK
 
(SDD422) Amazon VPC Deep Dive | AWS re:Invent 2014
(SDD422) Amazon VPC Deep Dive | AWS re:Invent 2014(SDD422) Amazon VPC Deep Dive | AWS re:Invent 2014
(SDD422) Amazon VPC Deep Dive | AWS re:Invent 2014
Amazon Web Services
 
10 Excellent Ways to Secure Spring Boot Applications - Okta Webinar 2020
10 Excellent Ways to Secure Spring Boot Applications - Okta Webinar 202010 Excellent Ways to Secure Spring Boot Applications - Okta Webinar 2020
10 Excellent Ways to Secure Spring Boot Applications - Okta Webinar 2020
Matt Raible
 
Itb session v_memcached
Itb session v_memcachedItb session v_memcached
Itb session v_memcached
Skills Matter
 
Burn down the silos! Helping dev and ops gel on high availability websites
Burn down the silos! Helping dev and ops gel on high availability websitesBurn down the silos! Helping dev and ops gel on high availability websites
Burn down the silos! Helping dev and ops gel on high availability websites
Lindsay Holmwood
 
Shopping for Vulnerabilities - How Cloud Service Provider Marketplaces can He...
Shopping for Vulnerabilities - How Cloud Service Provider Marketplaces can He...Shopping for Vulnerabilities - How Cloud Service Provider Marketplaces can He...
Shopping for Vulnerabilities - How Cloud Service Provider Marketplaces can He...
Tenchi Security
 
Shopping for Vulnerabilities - How Cloud Service Provider Marketplaces can He...
Shopping for Vulnerabilities - How Cloud Service Provider Marketplaces can He...Shopping for Vulnerabilities - How Cloud Service Provider Marketplaces can He...
Shopping for Vulnerabilities - How Cloud Service Provider Marketplaces can He...
Alexandre Sieira
 
10 Excellent Ways to Secure Your Spring Boot Application - Devoxx Belgium 2019
10 Excellent Ways to Secure Your Spring Boot Application - Devoxx Belgium 201910 Excellent Ways to Secure Your Spring Boot Application - Devoxx Belgium 2019
10 Excellent Ways to Secure Your Spring Boot Application - Devoxx Belgium 2019
Matt Raible
 
Deep Dive - Amazon Virtual Private Cloud (VPC)
Deep Dive - Amazon Virtual Private Cloud (VPC)Deep Dive - Amazon Virtual Private Cloud (VPC)
Deep Dive - Amazon Virtual Private Cloud (VPC)
Amazon Web Services
 
Deploying Rails App On Ec2
Deploying Rails App On Ec2Deploying Rails App On Ec2
Deploying Rails App On Ec2
Akhil Bansal
 
Continuous Delivery: The Next Frontier
Continuous Delivery: The Next FrontierContinuous Delivery: The Next Frontier
Continuous Delivery: The Next Frontier
Carlos Sanchez
 
AWS May Webinar Series - Deep Dive: Amazon Virtual Private Cloud
AWS May Webinar Series - Deep Dive: Amazon Virtual Private CloudAWS May Webinar Series - Deep Dive: Amazon Virtual Private Cloud
AWS May Webinar Series - Deep Dive: Amazon Virtual Private Cloud
Amazon Web Services
 
k8s-on-azure
 k8s-on-azure k8s-on-azure
k8s-on-azure
Ganesh Pol
 
Monkey man
Monkey manMonkey man
Monkey man
ShapeBlue
 
Null Bachaav - May 07 Attack Monitoring workshop.
Null Bachaav - May 07 Attack Monitoring workshop.Null Bachaav - May 07 Attack Monitoring workshop.
Null Bachaav - May 07 Attack Monitoring workshop.
Prajal Kulkarni
 
AWS Application Migration Service-Hands-On Guide
AWS Application Migration Service-Hands-On GuideAWS Application Migration Service-Hands-On Guide
AWS Application Migration Service-Hands-On Guide
Manas Mondal
 
Keep it simple web development stack
Keep it simple web development stackKeep it simple web development stack
Keep it simple web development stack
Eric Ahn
 
Configuration Management and Provisioning Are Different
Configuration Management and Provisioning Are DifferentConfiguration Management and Provisioning Are Different
Configuration Management and Provisioning Are Different
Carlos Nunez
 
One-Man Ops
One-Man OpsOne-Man Ops
One-Man Ops
Jos Boumans
 

Similar to AWS Study Group - Chapter 03 - Elasticity and Scalability Concepts [Solution Architect Associate Guide] (20)

My First Big Data Application
My First Big Data ApplicationMy First Big Data Application
My First Big Data Application
 
AWS Pentest.pdf
AWS Pentest.pdfAWS Pentest.pdf
AWS Pentest.pdf
 
(SDD422) Amazon VPC Deep Dive | AWS re:Invent 2014
(SDD422) Amazon VPC Deep Dive | AWS re:Invent 2014(SDD422) Amazon VPC Deep Dive | AWS re:Invent 2014
(SDD422) Amazon VPC Deep Dive | AWS re:Invent 2014
 
10 Excellent Ways to Secure Spring Boot Applications - Okta Webinar 2020
10 Excellent Ways to Secure Spring Boot Applications - Okta Webinar 202010 Excellent Ways to Secure Spring Boot Applications - Okta Webinar 2020
10 Excellent Ways to Secure Spring Boot Applications - Okta Webinar 2020
 
Itb session v_memcached
Itb session v_memcachedItb session v_memcached
Itb session v_memcached
 
Burn down the silos! Helping dev and ops gel on high availability websites
Burn down the silos! Helping dev and ops gel on high availability websitesBurn down the silos! Helping dev and ops gel on high availability websites
Burn down the silos! Helping dev and ops gel on high availability websites
 
Shopping for Vulnerabilities - How Cloud Service Provider Marketplaces can He...
Shopping for Vulnerabilities - How Cloud Service Provider Marketplaces can He...Shopping for Vulnerabilities - How Cloud Service Provider Marketplaces can He...
Shopping for Vulnerabilities - How Cloud Service Provider Marketplaces can He...
 
Shopping for Vulnerabilities - How Cloud Service Provider Marketplaces can He...
Shopping for Vulnerabilities - How Cloud Service Provider Marketplaces can He...Shopping for Vulnerabilities - How Cloud Service Provider Marketplaces can He...
Shopping for Vulnerabilities - How Cloud Service Provider Marketplaces can He...
 
10 Excellent Ways to Secure Your Spring Boot Application - Devoxx Belgium 2019
10 Excellent Ways to Secure Your Spring Boot Application - Devoxx Belgium 201910 Excellent Ways to Secure Your Spring Boot Application - Devoxx Belgium 2019
10 Excellent Ways to Secure Your Spring Boot Application - Devoxx Belgium 2019
 
Deep Dive - Amazon Virtual Private Cloud (VPC)
Deep Dive - Amazon Virtual Private Cloud (VPC)Deep Dive - Amazon Virtual Private Cloud (VPC)
Deep Dive - Amazon Virtual Private Cloud (VPC)
 
Deploying Rails App On Ec2
Deploying Rails App On Ec2Deploying Rails App On Ec2
Deploying Rails App On Ec2
 
Continuous Delivery: The Next Frontier
Continuous Delivery: The Next FrontierContinuous Delivery: The Next Frontier
Continuous Delivery: The Next Frontier
 
AWS May Webinar Series - Deep Dive: Amazon Virtual Private Cloud
AWS May Webinar Series - Deep Dive: Amazon Virtual Private CloudAWS May Webinar Series - Deep Dive: Amazon Virtual Private Cloud
AWS May Webinar Series - Deep Dive: Amazon Virtual Private Cloud
 
k8s-on-azure
 k8s-on-azure k8s-on-azure
k8s-on-azure
 
Monkey man
Monkey manMonkey man
Monkey man
 
Null Bachaav - May 07 Attack Monitoring workshop.
Null Bachaav - May 07 Attack Monitoring workshop.Null Bachaav - May 07 Attack Monitoring workshop.
Null Bachaav - May 07 Attack Monitoring workshop.
 
AWS Application Migration Service-Hands-On Guide
AWS Application Migration Service-Hands-On GuideAWS Application Migration Service-Hands-On Guide
AWS Application Migration Service-Hands-On Guide
 
Keep it simple web development stack
Keep it simple web development stackKeep it simple web development stack
Keep it simple web development stack
 
Configuration Management and Provisioning Are Different
Configuration Management and Provisioning Are DifferentConfiguration Management and Provisioning Are Different
Configuration Management and Provisioning Are Different
 
One-Man Ops
One-Man OpsOne-Man Ops
One-Man Ops
 

Recently uploaded

A Comprehensive Guide to DeFi Development Services in 2024
A Comprehensive Guide to DeFi Development Services in 2024A Comprehensive Guide to DeFi Development Services in 2024
A Comprehensive Guide to DeFi Development Services in 2024
Intelisync
 
Finale of the Year: Apply for Next One!
Finale of the Year: Apply for Next One!Finale of the Year: Apply for Next One!
Finale of the Year: Apply for Next One!
GDSC PJATK
 
AWS Cloud Cost Optimization Presentation.pptx
AWS Cloud Cost Optimization Presentation.pptxAWS Cloud Cost Optimization Presentation.pptx
AWS Cloud Cost Optimization Presentation.pptx
HarisZaheer8
 
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying AheadDigital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Wask
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
Zilliz
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
shyamraj55
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
Tomaz Bratanic
 
UI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentationUI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentation
Wouter Lemaire
 
Operating System Used by Users in day-to-day life.pptx
Operating System Used by Users in day-to-day life.pptxOperating System Used by Users in day-to-day life.pptx
Operating System Used by Users in day-to-day life.pptx
Pravash Chandra Das
 
Azure API Management to expose backend services securely
Azure API Management to expose backend services securelyAzure API Management to expose backend services securely
Azure API Management to expose backend services securely
Dinusha Kumarasiri
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
akankshawande
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
Jason Packer
 
Choosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptxChoosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptx
Brandon Minnick, MBA
 
Trusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process MiningTrusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process Mining
LucaBarbaro3
 
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
alexjohnson7307
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
panagenda
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
Zilliz
 
Recommendation System using RAG Architecture
Recommendation System using RAG ArchitectureRecommendation System using RAG Architecture
Recommendation System using RAG Architecture
fredae14
 
System Design Case Study: Building a Scalable E-Commerce Platform - Hiike
System Design Case Study: Building a Scalable E-Commerce Platform - HiikeSystem Design Case Study: Building a Scalable E-Commerce Platform - Hiike
System Design Case Study: Building a Scalable E-Commerce Platform - Hiike
Hiike
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
ssuserfac0301
 

Recently uploaded (20)

A Comprehensive Guide to DeFi Development Services in 2024
A Comprehensive Guide to DeFi Development Services in 2024A Comprehensive Guide to DeFi Development Services in 2024
A Comprehensive Guide to DeFi Development Services in 2024
 
Finale of the Year: Apply for Next One!
Finale of the Year: Apply for Next One!Finale of the Year: Apply for Next One!
Finale of the Year: Apply for Next One!
 
AWS Cloud Cost Optimization Presentation.pptx
AWS Cloud Cost Optimization Presentation.pptxAWS Cloud Cost Optimization Presentation.pptx
AWS Cloud Cost Optimization Presentation.pptx
 
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying AheadDigital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying Ahead
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
 
UI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentationUI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentation
 
Operating System Used by Users in day-to-day life.pptx
Operating System Used by Users in day-to-day life.pptxOperating System Used by Users in day-to-day life.pptx
Operating System Used by Users in day-to-day life.pptx
 
Azure API Management to expose backend services securely
Azure API Management to expose backend services securelyAzure API Management to expose backend services securely
Azure API Management to expose backend services securely
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
 
Choosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptxChoosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptx
 
Trusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process MiningTrusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process Mining
 
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
 
Recommendation System using RAG Architecture
Recommendation System using RAG ArchitectureRecommendation System using RAG Architecture
Recommendation System using RAG Architecture
 
System Design Case Study: Building a Scalable E-Commerce Platform - Hiike
System Design Case Study: Building a Scalable E-Commerce Platform - HiikeSystem Design Case Study: Building a Scalable E-Commerce Platform - Hiike
System Design Case Study: Building a Scalable E-Commerce Platform - Hiike
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
 

AWS Study Group - Chapter 03 - Elasticity and Scalability Concepts [Solution Architect Associate Guide]

  • 1. Study Group: AWS SAA Guide Chapter 03 - Elasticity and Scalability Concepts Aki Yu 2020.Apr
  • 2. ● AWS Certified Solutions Architect - Associate Guide https://www.amazon.com/AWS-Certified-Solutions-Architect-certification/dp/1789130662/ ● Google Books 上可讀到前3章: https://books.google.com.tw/books?id=P-l1DwAAQBAJ ● PacktPub 與 Oreilly 各有 10 Days Free Trial 可看書的完整內容: https://www.packtpub.com/virtualization-and-cloud/aws-certified-solution-architect-associate-guide https://www.oreilly.com/library/view/aws-certified-solutions/9781789130669/ ● 本書 Github Source Code: https://github.com/PacktPublishing/AWS-Certified-Solutions-Architect-Associate-Guide https://github.com/gabanox/Certified-Solution-Architect-Associate-Guide Book: AWS SAA Guide
  • 3. Ch3 Elasticity and Scalability Concepts • Technical requirements • Sources of failure • Dividing and conquering • Virtualization technologies • LAMP installation • Scaling the web server • Resiliency • EC2 persistence model • Disaster recovery • Cascading deletion • Bootstrapping • Scaling the compute layer • Scaling a database server • Summary • Further reading
  • 4. Ch3 Elasticity and Scalability Concepts AWS Command Line Interface https://aws.amazon.com/cli/ • Technical requirements • Sources of failure (S3) 1. No, you're not crazy. Part of the internet broke 2. How a typo took down S3, the backbone of the internet 3. Amazon S3 Outage Has Broken a Large Chunk of the Internet Root Cause - Typo Failure should be our teacher; as Thomas A. Edison said, "I have not failed. I've just found 10,000 ways that won't work."
  • 5. • Dividing and conquering (分而治之) Recovery Oriented Computing (ROC) 如果您有一個複雜的問題,請將其分解為各個易於管理的部分; 隔離它們,並專注於避免失敗的獨特策略。
  • 6. • Serial configuration RDS EBS • Parallel configuration • Active-Active (AA) • High Availability (HA) Warm Standby, Hot Standby, Cold
  • 7. • Reactive and proactive scalability Horizontal scalability To avoid single points of failure (SPOFs) Vertical scalability 加ram 加cpu 舉例來說 Elastic Compute Cloud (EC2) has different instance types, families, and sizes, which allows for the vertical scalability of a single compute node, as shown in the following screenshot: LAMP • Exercise
  • 8. • Virtualization technologies aws ec2 run-instances --image-id {ami-14c5486b}—key-name {BookShelfApp }
  • 9. NETWORK & SECURITY | Security Groups CLIENT_IP=$(curl -s http://checkip.amazonaws.com)"/32" aws ec2 authorize-security-group-ingress --group-name default --protocol tcp --port 22 --cidr $CLIENT_IP LAMP installation sudo yum update -y sudo yum install -y httpd24 php70 mysql56-server php70-mysqlnd sudo usermod -a -G apache ec2-user sudo chown -R ec2-user:apache /var/www sudo chmod 2775 /var/www find /var/www -type d -exec sudo chmod 2775 {} ; find /var/www -type f -exec sudo chmod 0664 {} ; echo "<?php phpinfo(); ?>" > /var/www/html/phpinfo.php
  • 10. aws ec2 authorize-security-group-ingress --group-id {sg-bddd92cb} --protocol tcp --port 80 --cidr 0.0.0.0/0
  • 11. Scaling the web server 1. Obtain the instance-id with the following expression: export CURRENT_INSTANCE=$(aws ec2 describe-instances --query 'Reservations[*].Instances[*].InstanceId' --filters 'Name=instance- state-name,Values=running' --output text) 2. We must stop the instance to change the instance-type attribute to m4.large, as follows: aws ec2 stop-instances --instance-id $CURRENT_INSTANCE --output json 3. Once stopped, modify the attribute via the CLI, as follows: aws ec2 modify-instance-attribute --instance-id $CURRENT_INSTANCE - -instance-type m4.large 4. Restart the instance, as follows: aws ec2 start-instances --instance-id $CURRENT_INSTANCE --output json
  • 12. Resiliency CURRENT_INSTANCE=$(aws ec2 describe-instances --query 'Reservations[*].Instances[*].InstanceId' --filter 'Name=tag:Name,Values=WebServer' --output text) aws ec2 reboot-instances --instance-ids $CURRENT_INSTANCE aws ec2 stop-instances --instance-id $CURRENT_INSTANCE aws ec2 start-instances --instance-id $CURRENT_INSTANCE aws ec2 allocate-address --domain vpc IP 會跑掉,所以做一個 ip先 aws ec2 associate-address --allocation-id {eipalloc-d300d8db} --instance-id $CURRENT_INSTANCE
  • 13. ./lsblk 列出 Block Device EC2 persistence model Xen hypervisors using HVM virtualization. Every EC2 instance has private access to a DNS metadata server within the VPC at the 169.254.169.254 canonical address. metadata server can be used to read information about the instance itself, along with the surrounding infrastructure in which it is running. This is valuable when you are writing bootstrapping scripts, applying application configurations, and even performing service authentication techniques. With a simple curl command, we can access the block-device-mapping information from this image. Direct Attached Storage (DAS) / Network Attached Storage (NAS)
  • 14. aws ec2 stop-instances --instance-id $CURRENT_INSTANCE aws ec2 detach-volume --volume-id {vol-0cae081b840a5d91e} aws ec2 attach-volume --volume-id vol-0cae081b840a5d91e --instance-id aws ec2 start-instances --instance-id $CURRENT_INSTANCE --output json Our file no longer exists.
  • 15. Direct Attached Storage (DAS) / Network Attached Storage (NAS) 1. To properly associate the volume, let's query the AZ in which this instance is currently running, as follows: aws ec2 describe-instances --instance-ids $CURRENT_INSTANCE -- output json --query 'Reservations[0].Instances[0].Placement' The result is as follows: { "Tenancy": "default", "GroupName": "", "AvailabilityZone": "us-east-1a" } 2. Create the volume by using the AvailabilityZone information, as follows: aws ec2 create-volume --size 80 --availability-zone $(aws ec2 describe-instances --instance-ids $CURRENT_INSTANCE --query 'Reservations[0].Instances[0].Placement.AvailabilityZone' --filter 'Name=tag:Name,Values=WebServer' --output text) --volume-type gp2 3. Now, describe the volumes that are available in order to find the status information, as follows: aws ec2 describe-volumes
  • 16. aws ec2 attach-volume --volume-id $(aws ec2 describe-volumes -- query 'Volumes[0].VolumeId' --output text) --instance-id $CURRENT_INSTANCE --device /dev/xvda sudo mkfs -t ext4 /dev/xvdb sudo mkdir /data sudo mount /dev/xvdb /data vi /etc/fstab
  • 17.
  • 18. Cascading deletion aws ec2 create-snapshot --volume-id vol-080c266f654bca621 -- description "Data volume first snapshot" aws ec2 describe-snapshots --owner-ids self aws ec2 delete-volume --volume-id vol-080c266f654bca621
  • 19. Bootstrapping cloud-init 1. We will provision our new instance by using the following user data input file. You can find this file in the GitHub repository under chapter02/bootstrap.txt: aws ec2 run-instances --image-id ami-14c5486b --key-name BookShelfApp --instance-type t2.medium --security-group-ids sg- bddd92cb --user-data file://bootstrap.txt 2. Refresh the current instance variable, as follows: export CURRENT_INSTANCE=$(aws ec2 describe-instances --query 'Reservations[*].Instances[*].InstanceId' --filters 'Name=instance- state-name,Values=running' --output text) 3. Now, associate the Elastic IP as follows: aws ec2 associate-address --allocation-id eipalloc-d300d8db -- instance-id $CURRENT_INSTANCE 4. Navigate to your Elastic IP address by using your web browser (in my case, it's 52.44.105.242); we can now validate that our web server was created from scratch, as shown in the following screenshot:
  • 20.
  • 21. Scaling the compute layer aws ec2 run-instances --image-id ami-14c5486b --key-name BookShelfApp --instance-type t2.large --security-group-ids sg- bddd92cb --user-data file://bootstrap.txt aws ec2 associate-address --instance-id i-096a8c337e10e9edf -- allocation-id eipalloc-d300d8db
  • 22. Proactive scalability Scaling a database server Create Read Replica
  • 24. • SRA 計算 serial configuration / parallel configuration • fstab 開機自動掛載 • Floating IP cloud pattern
  • 25. ● S3 - Simple Storage Service ● RDS - Rational Database Service ● EBS - Elastic Block Store 一般用途 SSD (gp2) 磁碟區 0.10 USD 佈建儲存每月每 GB 佈建 IOPS SSD (io1) 磁碟區 0.125 USD 佈建儲存每月每 GB和 0.065 USD 每月每個佈建 IOPS 輸送量優化 HDD (st1) 磁碟區 0.045 USD 佈建儲存每月每 GB 冷 HDD (sc1) 磁碟區 0.025 USD 佈建儲存每月每 GB 磁帶 ● HA● AA
  • 26. ● EC2 - Elastic Compute Cloud ● AMI - Amazon Machine Image ● LAMP - Linux、Apache、MySQL、PHP ● PV - ParaVirtualization ● HVM - Hardware Virtual Machine ● Xen hypervisor