EC2实例不会让弹性IP [英] EC2 Instances will not keep elastic IP

查看:324
本文介绍了EC2实例不会让弹性IP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以,我不明白是怎么回事,我还(3),它们推出的微型EC2实例(没有弹性IP)

So, I don't understand what is going on here... I have (3) Micro EC2 Instances which are launched (without elastic ip)

然后我去网​​络安全 - >弹性IP地址并单击关联的IP地址。我选择了一个正在运行的EC2实例,该实例则使用了弹性IP。

I then go to Network Security->Elastic IPs and click associate IP address. I chose a running EC2 instance, that instance then uses the elastic ip.

如果我停止然后启动此相同的EC2实例,它没有同一previous弹性的IP地址,是代替一些完全新的IP地址。这被搞乱了,然后依靠pviously相关的弹性IP到EC2实例的$ P $脚本。

If I stop, then start this SAME ec2 instance, it doesnt have the same previous elastic IP address and is instead some completely new IP address. This is messing up scripts that then depend on the previously associated elastic ip to that EC2 instance.

这是怎么回事,为什么我倾斜得到任何的(3)实例的采纳和保持这种分配弹性IP?

Why is this happening and why cant i get any of the (3) instances to adopt and keep this assigned elastic ip?

推荐答案

弹性IP地址成为解除关联与EC2实例(在EC2-经典)当您阻止他们。您将需要重新启动时,可以通过API来完成(通过重新关联他们,<一个href="http://docs.aws.amazon.com/AWSEC2/latest/APIReference/ApiReference-query-AssociateAddress.html"相对=nofollow> AssociateAddress ),CLI(通过<一个href="http://docs.aws.amazon.com/AWSEC2/latest/CommandLineReference/ApiReference-cmd-AssociateAddress.html"相对=nofollow> EC2-副地址),或<一href="http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html#using-instance-addressing-eips-associating"相对=nofollow>通过AWS控制台。

Elastic IPs become disassociated with EC2 instances (in EC2-Classic) when you stop them. You will need to re-associate them again on startup, which can be done through the API (via AssociateAddress), CLI (via ec2-associate-address), or via the AWS Console.

下面就是弹性IP <一href="http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html#concepts-elastic-addressing"相对=nofollow>文档不得不说的事:

Here's what the Elastic IP documentation has to say on the matter:

当您的EIP与实例,该实例的当前关联   公网IP地址被释放到EC2-经典的公网IP​​地址   池。如果您撇清从实例中的生态工业园,该实例   在几分钟之内自动分配一个新的公共IP地址。   此外,停止实例也离解的EIP从它。

When you associate an EIP with an instance, the instance's current public IP address is released to the EC2-Classic public IP address pool. If you disassociate an EIP from the instance, the instance is automatically assigned a new public IP address within a few minutes. In addition, stopping the instance also disassociates the EIP from it.

我们解决这个问题的工作被标记我们的开发实例(其中已关闭过夜)与所需的弹性IP,并在上午运行脚本首先打开它们,然后重新关联弹性IP。

We solve this at work by tagging our dev instances (which are turned off overnight) with the desired elastic IP and run a script in the morning to first turn them on, and then re-associate the elastic IP.

这篇关于EC2实例不会让弹性IP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆