问题描述
我有一个托管CentOS AMI映像的ec2实例,并且根设备是EBS,但是它没有经过EBS优化.
I have an ec2 instance that is hosting a CentOS AMI image and the root device is EBS , however it is not EBS optimized.
我现在已经安装了一些软件包,我想停止然后重新启动它,Amazon文档说EBS数据可用,但实例存储数据将丢失.
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.
我如何知道我的包裹存储在哪里(EBS或实例存储)?我看到软件包文件位于/opr/var/etc目录中.
How do I know where(EBS or Instance store) my packages are stored ? I see that package files are in /opr /var /etc directories .
如果我停止并启动Amazon ec2实例,我是否会松开已安装的软件包?
Will I loose my installed packages if I stop and start the Amazon ec2 instance ?
谢谢.
推荐答案
当您创建EBS支持的实例(具有临时存储或实例存储存储,并且无论是否优化)都不会丢失/opt
或/var
或/etc
目录中的数据或任何系统数据.因此,您可以安全地停止然后重新启动它.请记住,您的内部和公共IP地址在重新启动后都会更改.
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.
丢失的唯一数据是如果您具有临时卷,这些临时卷通常是使用/dev/sdb,/dev/xvdb,/dev/xvdc等设备安装的卷.
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.
如果创建实例存储仅"实例,则将丢失所有内容.但是,您可以通过不选择停止"实例来判断您的实例是否为这种类型.意味着您只能终止它.这些是EC2在启动时提供的第一种实例类型,也许直到3-4年前才提供,因此它们不会使用那么多AFAIK,除非您需要临时卷作为根卷.
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.
这是EBS支持的实例(未优化)的外观:
This is what it's supposed to look like for an EBS backed instance (non-optimized):
这篇关于当我停止并启动ec2 cents os实例时,我丢失了哪些数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!