SlideShare une entreprise Scribd logo
1  sur  26
Télécharger pour lire hors ligne
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

Contenu connexe

Tendances

(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 WAFAmazon 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 SummitAmazon 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
 
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 practicesStoyan 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 2010releasebeta
 
Amazon web services quick guide - tutorialspoint
Amazon web services   quick guide - tutorialspointAmazon web services   quick guide - tutorialspoint
Amazon web services quick guide - tutorialspointVishnu 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 OktaAmazon 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 2013Amazon Web Services
 
Cloud Security At Netflix, October 2013
Cloud Security At Netflix, October 2013Cloud Security At Netflix, October 2013
Cloud Security At Netflix, October 2013Jay 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 @ NetflixJason 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 LessAmazon Web Services
 
(SEC306) Defending Against DDoS Attacks
(SEC306) Defending Against DDoS Attacks(SEC306) Defending Against DDoS Attacks
(SEC306) Defending Against DDoS AttacksAmazon 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 DesignAmazon Web Services
 

Tendances (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
 

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

(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 2014Amazon 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 2020Matt Raible
 
Itb session v_memcached
Itb session v_memcachedItb session v_memcached
Itb session v_memcachedSkills 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 websitesLindsay 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 2019Matt 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 Ec2Akhil Bansal
 
Continuous Delivery: The Next Frontier
Continuous Delivery: The Next FrontierContinuous Delivery: The Next Frontier
Continuous Delivery: The Next FrontierCarlos 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 CloudAmazon Web Services
 
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 GuideManas Mondal
 
Keep it simple web development stack
Keep it simple web development stackKeep it simple web development stack
Keep it simple web development stackEric Ahn
 
Configuration Management and Provisioning Are Different
Configuration Management and Provisioning Are DifferentConfiguration Management and Provisioning Are Different
Configuration Management and Provisioning Are DifferentCarlos Nunez
 

Similaire à 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
 

Dernier

WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesZilliz
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 

Dernier (20)

WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector Databases
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 

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