When I stop and start an ec2 cents os instance , what data do I loose

邮差的信 提交于 2020-01-16 13:21:11

问题


I have an ec2 instance that is hosting a CentOS AMI image and the root device is EBS , however it is not EBS optimized.

I have installed a few packages on it now I want to stop and start it again , Amazon documentation says that the EBS data would be available but the instance store data would be lost.

How do I know where(EBS or Instance store) my packages are stored ? I see that package files are in /opr /var /etc directories .

Will I loose my installed packages if I stop and start the Amazon ec2 instance ?

Thanks.


回答1:


When you create an EBS backed instance (with ephemeral or instance store storage, and it doesn't matter whether it's optimized or not optimized) you don't lose data in your /opt or /var or /etc directory or any of the system data. So you are safe to stop and then restart it. Keep in mind that your internal and public IP addresses change once you restart it.

The only data that you lose is if you have ephemeral volumes which are generally mounted volumes with devices like /dev/sdb, /dev/xvdb, /dev/xvdc, etc.

If you create an instance store "only" instance then you lose everything. However, you will be able to tell if your instance is this type by not having the option to "stop" it. Meaning you can only terminate it. These are the first type of instances that EC2 offered when they started and maybe up until 3-4 years ago were the only ones, so they are not used that much AFAIK unless you need an ephemeral volume as your root volume.

[Edit]

This is what it's supposed to look like for an EBS backed instance (non-optimized):




回答2:


You will not lose your data if the instance is setup as EBS.

EBS optimised is another option which adds additional IOPS, useful for busy database applications, etc.



来源:https://stackoverflow.com/questions/21950080/when-i-stop-and-start-an-ec2-cents-os-instance-what-data-do-i-loose

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!