2.5 Amazon EC2 Storage

本文详细介绍了Amazon EC2提供的四种主要存储选项:持久的Amazon EBS卷、临时的实例存储、弹性文件系统EFS和成本效益高的Amazon S3。探讨了它们的特点、适用场景和操作方式,包括EBS的优化实例、EFS的文件共享和S3的数据存储特性。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Overview

Amazon EC2 provides you with flexible, cost effective, and easy-to-use data storage options for your instances. 

These storage options include the following:

  • Amazon EBS

  • Amazon EC2 instance store

  • Amazon EFS file system

  • Amazon S3

The following figure shows the relationship between these storage options and your instance.

Storage options for Amazon EC2

  • Every time you launch an instance from an AMI, a root storage device is created for that instance. The root storage device contains all the information necessary to boot the instance. 

Amazon EBS

  • Amazon EBS provides durable, block-level storage volumes that you can attach to a running instance.
  • You can use Amazon EBS as a primary storage device for data that requires frequent and granular updates
  • The volume persists independently from the running life of an instance.
  • As illustrated in the previous figure, multiple volumes can be attached to an instance. You can also detach an EBS volume from one instance and attach it to another instance.
  • You can dynamically change the configuration of a volume attached to an instance.
  • EBS volumes can also be created as encrypted volumes using the Amazon EBS encryption feature.
  • To keep a backup copy of your data, you can create a snapshot of an EBS volume, which is stored in Amazon S3.
  • You can create an EBS volume from a snapshot, and attach it to another instance. 

Amazon EBS–optimized instances

  • An Amazon EBS–optimized instance uses an optimized configuration stack and provides additional, dedicated capacity for Amazon EBS I/O.
  • This optimization provides the best performance for your EBS volumes by minimizing contention between Amazon EBS I/O and other traffic from your instance.
  • EBS–optimized instances deliver dedicated bandwidth to Amazon EBS

Amazon EC2 instance store

  • Many instances can access storage from disks that are physically attached to the host computer. This disk storage is referred to as instance store.
  • Instance store provides temporary block-level storage for instances.
  •  Instance store is ideal for temporary storage of information that changes frequently, such as buffers, caches, scratch data, and other temporary content, or for data that is replicated across a fleet of instances, such as a load-balanced pool of web servers.
  • An instance store consists of one or more instance store volumes exposed as block devices.
  • After you launch an instance, the instance store volumes are available to the instance, but you can't access them until they are mounted. 

Instance store lifetime

  • You can specify instance store volumes for an instance only when you launch it.
  • You can't detach an instance store volume from one instance and attach it to a different instance.
  • The data on an instance store volume persists only during the life of the associated instance; if you stop, hibernate, or terminate an instance, any data on instance store volumes is lost. 
  • If an instance reboots (intentionally or unintentionally), data in the instance store persists.
  • If you change the instance type, an instance store will not be attached to the new instance type If the number of instance store volumes in a block device mapping exceeds the number of instance store volumes available to an instance, the additional volumes are ignored.

Amazon EFS file system

  • Amazon EFS provides scalable file storage for use with Amazon EC2.
  • You can create an EFS file system and configure your instances to mount the file system.
  • You can use an EFS file system as a common data source for workloads and applications running on multiple instances. 

Amazon S3

  • Amazon S3 provides access to reliable, fast, and inexpensive data storage infrastructure. 
  • It is designed to make web-scale computing easier by enabling you to store and retrieve any amount of data, at any time, from within Amazon EC2 or anywhere on the web.
  • Amazon EC2 uses Amazon S3 to store EBS snapshots and instance store-backed AMIs
  •  Amazon S3 stores data objects redundantly on multiple devices across multiple facilities and allows concurrent read or write access to these data objects by many separate clients or application threads.
  • Amazon EFS enables you to create a file system that multiple instances can mount and access at the same time

Block Device Mappings

  • You specify the EBS volumes and instance store volumes for your instance using a block device mapping.
  • Each entry in a block device mapping includes a device name and the volume that it maps to.
  • The default block device mapping is specified by the AMI you use. Alternatively, you can specify a block device mapping for the instance when you launch it.
  • A block device mapping always specifies the root volume for the instance. The root volume is either an Amazon EBS volume or an instance store volume. 
  • You can use a block device mapping to specify additional EBS volumes when you launch your instance, or you can attach additional EBS volumes after your instance is running
  • The only way to attach instance store volumes to an instance is to use block device mapping to attach the volumes as the instance is launched.
  • Each AMI has a block device mapping that specifies the block devices to attach to an instance when it is launched from the AMI. An AMI that Amazon provides includes a root device only. 

Relationship between instance, instance store volumes, and EBS volumes.

Reference

https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Storage.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值