AWS助理架构师认证培训 | EC2 Instance Storage

视频来源:B站《AWS 认证解决方案架构师 助理级 SAA-C03》

一边学习一边整理老师的课程内容及试验笔记,并与大家分享,侵权即删,谢谢支持!

附上汇总贴:AWS助理架构师认证培训 | 汇总_热爱编程的通信人的博客-CSDN博客


EBS Overview

What's an EBS Volume?

  • An EBS (Elastic Block Store) Volume is a network drive you can attach to your instances while they run
  • It allows your instances to persist data, even after their termination
  • They can only be mounted to one instance at a time (at the CCP level)
  • They are bound to a specific availability zone
  • Analogy: Think of them as a "network USB stick"
  • Free tier: 30GB of free EBS storage of type General Purpose (SSD) or Magnetic per month

EBS Volume

  • It a network drive (i.e. not a physical drive)It uses the network to communicate the instance, which means there might be a bit of latencyIt can be detached from an EC2 instance and attached to another one quickly
  • lt's locked to an Availability Zone (AZ)An EBS Volume in us-east-1a can not be attached to us-east-1b To move a volume across, you first need to snapshot it
  • Have a provisioned capacity (size in GBs, and IOPS)You get billed for all the provisioned capacityYou can increase the capacity of the drive over time

EBS Volume - Example

EBS - Delete on Termination attribute

  • Controls the EBS behaviour when a nEC 2 instance terminates By default, the root EBS volume is deleted (attribute enabled)By default, any other attached EBS volume is not deleted (attribute disabled)
  • This can be controlled by the AWS console / AWS CLI
  • Use case: preserve root volume when instance is terminated

EBS Snapshots

EBS Snapshots

  • Make a backup (snapshot) of your EBS volume at a point in time
  • Not necessary to detach volume to do snapshot, but recommended
  • Can copy snapshots across AZ or Region

EBS Snapshots Features

  • EBS Snapshot ArchiveMove a Snapshot to an "archive tier" that is 75% cheaperTakes within 24 to 72 hours for restoring the archive
  • Recycle Bin for EBS SnapshotsSetup rules to retain deleted snapshots so you can recover them after an accidental deletion Specify retention (from 1 day to 1 year)
  • Fast Snapshot Restore (FSR)Force full initialization of snapshot to have no latency on the first use ($$$)

AMI Overview

AMI Overview

  • AMI = Amazon Machine Image
  • AMl are a customization of an EC2 instanceYou add your own software, configuration, operating system, monitoring...Faster boot / configuration time because all your software is pre-packaged
  • AMI are built for a specific region (and can be copied across regions)
  • You can launch EC2 instances from:A Public AMI: AWS providedYour own AMl: you make and maintain them yourselfAn AWS Marketplace AMl: an AMI someone else made (and potentially sells)

AMI Process (from an EC2 instance)

  • Start an EC2 instance and customize it
  • Stop the instance (for data integrity)
  • Build an AMI - this will also create EBS snapshots
  • Launch instances from other AMIs

EC2 Instance Store

EC2 Instance Store

  • EBS volumes are network drives with good but "imited" performance
  • lf you need a high-performance hardware disk, use EC2 Instance Store
  • Better l/O performance
  • EC2 Instance Store lose their storage if they're stopped (ephemeral)
  • Good for buffer / cache / scratch data / temporary content
  • Risk of data loss if hardware fails
  • Backups and Replication are your responsibility

Local EC2 Instance Store

EBS Volume Types

EBS Volume Types

  • EBS Volumes come in 6 typesgp2 / gp3 (SSD): General purpose SSD volume that balances price and performance for a wide variety of workloads io1 / io2 (SSD): Highest-performance SSD volume for mission-critical low-latency or high-throughput workloadsst1 (HDD): Low cost HDD volume designed for frequently accessed, throughput-intensive workloadssc1 (HDD): Lowest cost HDD volume designed for less frequently accessed workloads
  • EBS Volumes are characterized ir Size | Throughput | IOPS (I/O Ops Per Sec)
  • When in doubt always consult the AWS documentation - it's good!
  • Only gp2/gp3 and io1/io2 can be used as boot volumes

EBS Volume Types Use cases General Purpose SSD

  • Cost effective storage, low-latency
  • System boot volumes, Virtual desktops, Development and test environments
  • 1 GiB - 16 TiB
  • gp3:Baseline of 3,000 IOPS and throughput of 125 MiB/sCan increase IOPS up to 16,000 and throughput up to 1000 MiB/s independently
  • gp2:Small gp2 volumes can burst IOPS to 3,000Size of the volume and IOPS are linked, max IOPS is 16,0003 lOPS per GB, means at 5,334 GB we are at the max IOPS

EBS Volume Types Use cases Provisioned IOPS (PIOPS) SSD

  • Critical business applications with sustained IOPS performance
  • Or applications that need more than 16,000 IOPS
  • Great for databases workloads (sensitive to storage perf and consistency)
  • io1/io2 (4 GiB - 16 TiB):Max PIOPS: 64,000 for Nitro EC2 instances & 32,000 for other Can increase PIOPS independently from storage sizeio2 have more durability and more IOPS per GiB (at the same price as io1)
  • io2 Block Express (4 GiB - 64 TiB):Sub-millisecond latencyMax PIOPS: 256,000 with an IOPS:GiB ratio of 1,000:1
  • Supports EBS Multi-attach

EBS Volume Types Use cases Hard Disk Drives (HDD)

  • Cannot be a boot volume
  • 125 MiB to 16 TiB
  • Throughput Optimized HDD (st1)Big Data, Data Warehouses, Log Processing Max throughput 500MiB/s - max IOPS 500\
  • Cold HDD (sc1):For data that is infrequently accessedScenarios where lowest cost is important Max throughput 250 MiB/s - max IOPS 250

EBS - Volume Types Summary

EBS Multi-Attach

EBS Multi-Attach - io1/io2 family

  • Attach the same EBS volume to multiple EC2 instances in the same AZ
  • Each instance has full read & write permissions to the high-performance volume
  • Use case:Achieve higher application availability in clustered Linux applications (ex: Teradata)Applications must manage concurrent write operations
  • Up to 16 EC2 Instances at a time
  • Must use a file system that's cluster-aware (not XFS, EX4, etc...)

EBS Encryption

EBS Encryption

  • When you create an encrypted EBS volume, you get the following:Data at rest is encrypted inside the volumeAll the data in flight moving between the instance and the volume is encryptedAll snapshots are encryptedAll volumes created from the snapshot
  • Encryption and decryption are handled transparently (you have nothing to do)
  • Encryption has a minimal impact on latency
  • EBS Encryption leverages keys from KMS (AES-256)
  • Copying an unencrypted snapshot allows encryption
  • Snapshots of encrypted volumes are encrypted

Encryption: encrypt an unencrypted EBS volume

  • Create an EBS snapshot of the volume
  • Encrypt the EBS snapshot (using copy)
  • Create new ebs volume from the snapshot (the volume will also be encrypted)
  • Now you can attach the encrypted volume to the original instance

Amazon EFS

Amazon EFS - Elastic File System

  • Managed NFS (network filesystem) that can be mounted on many EC2
  • EFS works with EC2 instances in multi-AZ
  • Highly available, scalable, expensive (3x gp2), pay per use

Amazon EFS - Elastic File System

  • Use cases: content management, web serving, data sharing, Wordpress
  • Uses NFSv4.1 protocol
  • Uses security group to control access to EFS
  • Compatible with Linux based AMI (not Windows)
  • Encryption at rest using KMS
  • POSIX file system (~Linux) that has a standard file API
  • File system scales automatically, pay-per-use, no capacity planning!

EFS - Performance & Storage Classes

  • EFS Scale1000s of concurrent NFS clients, 10 GB+ /s throughputGrow to Petabyte-scale network filesystem, automatically
  • Performance mode (set at EFS creation time)General purpose (default): latency-sensitive use cases (web server, CMS, etc...)Max I/O - higher latency, throughput, highly parallel (big data, media processing)
  • Throughput modeBursting (1 TB = 50MiB/s + burst of up to 100MiB/s)Provisioned: set your throughput regardless of storage size, ex: 1 GiB/s for 1 TB storage

EFS - Storage Classes

  • Storage Tiers (lifecycle management feature - move file after N days)Standard: for frequently accessed filesInfrequent access (EFS-IA): cost to retrieve files, lower price to store. Enable EFS-IA with a Lifecycle Policy
  • Availability and durabilityStandard: Multi-AZ, great for prodOne Zone: One AZ, great for dev, backup enabled by default, compatible with IA (EFS One Zone-lA)Over 90% in cost savings

EFS vs EBS

EBS vs EFS - Elastic Block Storage

  • EBS volumes...can be attached to only one instance at a time are locked at the Availabity Zone (AZ) level gp2: IO increases if the disk size increasesio1: can increase IO independently
  • To migrate an EBS volume across AZTake a snapshotRestore the snapshot to another AZEBS backups use IO and you shouldn't run them while your application is handling a lot of traffic
  • Root EBS Volumes of instances get terminated by default if the EC2 instance gets terminated. (you can disable that)

EBS vs EFS - Elastic FileSystem

  • Mounting 100s of instances across AZ
  • EFS share website files (WordPress)
  • Only for Linux Instances (POSIX)
  • EFS has a higher price point than EBS
  • Can leverage EFS-IA for cost savings
  • Remember: EFS vs EBS vs Instance Store

猜你喜欢

转载自blog.csdn.net/guolianggsta/article/details/131784492