我正在尝试停止Amazon EC2实例并获得警告消息
警告:请注意,实例的临时存储上的任何数据在停止时都将丢失。
我的问题
哪些数据存储在Amazon EC2实例的临时存储中?
我正在尝试停止Amazon EC2实例并获得警告消息
警告:请注意,实例的临时存储上的任何数据在停止时都将丢失。
我的问题
哪些数据存储在Amazon EC2实例的临时存储中?
当前回答
参见:https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/InstanceStorage.html # instance-store-volumes
The data in an instance store persists only during the lifetime of
its associated instance. If an instance reboots (intentionally or
unintentionally), data in the instance store persists. However,
data in the instance store is lost under any of the following
circumstances:
- The underlying disk drive fails
- The instance stops
- The instance hibernates
- The instance terminates
其他回答
参见:https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/InstanceStorage.html # instance-store-volumes
The data in an instance store persists only during the lifetime of
its associated instance. If an instance reboots (intentionally or
unintentionally), data in the instance store persists. However,
data in the instance store is lost under any of the following
circumstances:
- The underlying disk drive fails
- The instance stops
- The instance hibernates
- The instance terminates
要清楚地回答@Dean的问题:ebs类型的根存储似乎不是短暂的。数据在重启过程中是持久的,实际上使用ebs支持的根卷是“短暂的”,这没有任何意义。这与基于图像的根卷没有什么不同。
According to AWS documentation [https://aws.amazon.com/premiumsupport/knowledge-center/instance-store-vs-ebs/] instance store volumes is not persistent through instance stops, terminations, or hardware failures. Any AMI created from instance stored disk doesn't contain data present in instance store so all instances launched by this AMI will not have data stored in instance store. Instance store can be used as cache for applications running on instance, for all persistent data you should use EBS.
对于EC2实例
Stop & Start != Reboot
对于临时存储(实例存储) 停止导致数据丢失 重启不会
没有存储在挂载到实例的EBS卷上的任何内容都将丢失。
例如,如果您在/mystuff上挂载EBS卷,那么不在/mystuff中的任何内容都将丢失。如果您不挂载ebs卷并在其上保存内容,那么我相信所有内容都将丢失。
您可以从当前的机器状态创建一个AMI,它将包含临时存储中的所有内容。然后,当您基于该AMI启动一个新实例时,它将像现在一样包含所有内容。
更新:根据mattgmg1990和glenn bech的评论澄清:
注意"stop"和"terminate"是有区别的。如果您“停止”一个由EBS支持的实例,那么当您再次“启动”计算机时,根卷上的信息仍将处于相同的状态。根据文档,“默认情况下,启动支持Amazon EBS的实例时附加的根设备卷和其他Amazon EBS卷将在实例终止时自动删除”,但您可以通过配置修改这一点。