简体   繁体   English

如果 EC2 AWS 实例崩溃,公共 IP 会发生什么情况?

[英]What happens to the public IP if an EC2 AWS instance crashes?

https://aws.amazon.com/ec2/faqs/#Elastic_IP https://aws.amazon.com/ec2/faqs/#Elastic_IP

The public address is associated exclusively with the instance until it is stopped, terminated or replaced with an Elastic IP address.公共地址仅与实例关联,直到它被停止、终止或替换为弹性 IP 地址。

I know what Elastic_IPs are, but there are limits to their availability in a given region.我知道 Elastic_IP 是什么,但它们在给定区域的可用性存在限制。

So if I create an EC2 instance in a given region, and it has not an Elastic IP, then according to the AWS SLAs of somewhere between 95% and 99.99% monthly percentage uptime I need to consider that the machine could be unavailable for some other reason (not initiated by us).因此,如果我在给定区域创建一个 EC2 实例,并且它没有弹性 IP,那么根据 AWS SLA 每月正常运行时间百分比介于 95% 和 99.99% 之间,我需要考虑该机器可能无法用于其他一些原因(不是我们发起的)。

Let's call this scenario a "crash" (other scenarios like AWS maintenance or general region unavailability fall into this as well imho).让我们将此场景称为“崩溃”(其他场景,如 AWS 维护或一般区域不可用,恕我直言)。

Will the instance keep its IP?实例会保留其 IP 吗?

I don't care if it crashes or becomes unavailable.我不在乎它是否崩溃或变得不可用。 I can recover.我可以恢复。 I need to know if in that case I have the same IP.我需要知道在这种情况下我是否有相同的 IP。

If the instance stops and starts again (from the AWS API perspective) then yes the the public IP address will be added to the pool, with a new one being attached when the instance starts.如果实例停止并再次启动(从 AWS API 角度来看),那么是的,公共 IP 地址将添加到池中,并在实例启动时附加一个新地址。

If you're trying to prevent DNS issues and elastic IP addresses are not supported in your region, then you should instead look at attaching your instance being a load balancer.如果您试图防止 DNS 问题并且您所在区域不支持弹性 IP 地址,那么您应该考虑将您的实例附加为负载均衡器。 Then add your instance as a target of this, with any DNS records set to the CNAME of the ELB.然后将您的实例添加为此目标,并将任何 DNS 记录设置为 ELB 的 CNAME。

This is depended upon the maintenance by AWS, Usually, Amazon EC2 maintenance is a live-update to minimize customer impact.这取决于 AWS 的维护,通常,Amazon EC2 维护是实时更新,以尽量减少对客户的影响。 Sometimes, however, a live-update is not possible , and therefore a scheduled maintenance event is needed.但是,有时无法进行实时更新,因此需要计划的维护活动。

A scheduled maintenance event might require your instance to undergo one of the following:计划的维护事件可能需要您的实例经历以下情况之一:

  • Stop or retire停止或退休
  • Reboot重启
  • Lose network connectivity or power失去网络连接或电源

In case of stop and restart either its schedule or manual you instance will release the public IP/DNS address.如果停止并重新启动其计划或手动,您的实例将释放公共 IP/DNS 地址。

Important : Stopping and restarting the instance changes the public IP address of your instance.重要提示:停止和重新启动实例会更改您的实例的公共 IP 地址 It's a best practice to use an Elastic IP address instead of a public IP address when routing external traffic to your instance.将外部流量路由到您的实例时,最好使用弹性 IP 地址而不是公共 IP 地址。

EC2 Stop_Start EC2 停止_启动

In case of Reboot , it will preserve the public IP address.Reboot的情况下,它将保留公共 IP 地址。

An instance reboot is equivalent to an operating system reboot.实例重启相当于操作系统重启。 In most cases, it takes only a few minutes to reboot your instance.在大多数情况下,重启您的实例只需几分钟。 When you reboot an instance, it keeps its public DNS name (IPv4), private IPv4 address, IPv6 address (if applicable), and any data on its instance store volumes.当您重新启动实例时,它会保留其公共 DNS 名称 (IPv4)、私有 IPv4 地址、IPv6 地址(如果适用)以及其实例存储卷上的任何数据。

ec2-instance-reboot ec2-实例重启

In case of Lose Network connectivity or power , have both chances if it required stop and restart then it will lose public IP, if required just reboot then it will preserve the IP adress.丢失网络连接或电源的情况下,如果需要停止和重新启动,则有两种机会,然后它将丢失公共 IP,如果需要重新启动,它将保留 IP 地址。

During network maintenance, scheduled instances lose network connectivity for a brief period of time.在网络维护期间,计划实例会在短时间内失去网络连接。 Normal network connectivity to your instance is restored after maintenance is complete.维护完成后,与您的实例的正常网络连接将恢复。

During power maintenance, scheduled instances are taken offline for a brief period, and then rebooted.在电源维护期间,计划的实例会在短时间内脱机,然后重新启动。 When a reboot is performed, all of your instance's configuration settings are retained.执行重启时,您的实例的所有配置设置都会保留。

Lose network connectivity or power 失去网络连接或电源

For the use cane you can look into ec2-scheduled-maintenance-action对于使用手杖,您可以查看ec2-scheduled-maintenance-action

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 AWS - 在同一个公共子网中连接一个带有私有 ip 的 ec2 实例和一个带有公共 ip 的 ec2 实例? - AWS - Connecting an ec2 instance with a private ip and an ec2 instance with a public ip in the same public subnet? AWS Java SDK - 使用公共IP启动EC2 Spot实例 - AWS Java SDK - launching an EC2 Spot instance with a public IP 无法使用公共 IP ping AWS EC2 实例 - Cannot ping AWS EC2 instance with public IP AWS从EC2实例访问其自己的公共IP - aws access from ec2 instance to its own public ip AWS - EC2 - Ubuntu 实例公共 ip 拒绝连接 - AWS - EC2 - Ubuntu instance public ip refused to connect 当 EC2 实例升级时,AWS 内部会发生什么 - What happens internally in AWS when EC2 instance is upgraded 当 AWS EC2 实例超过休眠限制时会发生什么? - What happens when AWS EC2 instance exceeds the hibernation limit? 从 EC2 实例“分离弹性 IP 地址”后,将公共 IP 自动分配给 AWS EC2 实例 - Auto assign of public IP to AWS EC2 instance after "Dissociate Elastic IP address" from EC2 instance 我们可以将只有私有 IP 的 AWS ec2 实例与另一个具有公共 IP 的 ec2 实例连接起来吗? 从腻子 - can we connect AWS ec2 instance which is having only private IP with the other ec2 instance with a public IP ? from putty 使用公共IP将EC2实例启动到vpc中 - Launching EC2 instance into vpc and with a public IP
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM