gpt4 book ai didi

amazon-ec2 - 在硬件故障期间,基于 EBS 的 EC2 实例是终止还是停止?

转载 作者:行者123 更新时间:2023-12-01 02:51:03 25 4
gpt4 key购买 nike

亚马逊新的基于 EBS 的 EC2 实例有两个关闭选项:终止或停止。停止的实例稍后可以再次启动,自动从它们停止时的相同 EBS 根磁盘状态继续。

但是当 Amazon 数据中心出现硬件故障并且 EC2 实例被迫关闭时会发生什么。它是终止还是停止?如果实例已配置为在关闭时默认停止,我是否可以依赖它在这种情况下也被停止,并能够在以后再次启动它?

最佳答案

EC2 实例可以随时终止,并且确实必须考虑到这一点,正如在 David's answer 中已经提到的那样。 (+1)。您可以安排失败实例的Elastic Block Store (EBS)无论如何都要保持可用,请参见例如相应的常见问题解答 What happens to my data when a system terminates? :

The data stored on a local instance store will persist only as long as that instance is alive. However, data that is stored on an Amazon EBS volume will persist independently of the life of the instance. If you are using an Amazon EBS volume as a root partition, then you have set the Delete On Terminate flag to "N" for your Amazon EBS volume to persist outside the life of the instance. [emphasis mine]



这在 Eric Hammond 推荐文章 Three Ways to Protect EC2 Instances from Accidental Termination and Loss of Data 中的第 2 节中更详细地解释。 :

Though EBS volumes created and attached to an instance at instantiation are preserved through a “stop”/”start” cycle, by default they are destroyed and lost when an EC2 instance is terminated. This behavior can be changed with a delete-on-termination boolean value buried in the documentation for the --block-device-mapping option of ec2-run-instances.



他指的是 ec2-run-instances文档,同时在 Amazon EC2 Root Device Storage Concepts 中更详细地说明了所有这些。还有:

By default, the root device volume and the other volumes created when an Amazon EBS-backed instance is launched are automatically deleted when the instance terminates [...]. You can change the default behavior by setting the DeleteOnTermination flag to the value you want when you launch the instance. For an example of how to change the flag at launch time, see Using Amazon EC2 Root Device Storage.

关于amazon-ec2 - 在硬件故障期间,基于 EBS 的 EC2 实例是终止还是停止?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4973204/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com