解决方案AWS EC2实例的本地IP变化 [英] Solution for local ip changes of AWS EC2 instances

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

问题描述

亚马逊只给你一定数量的静态IP地址,每个EC2实例的本地(私有)IPS当机器重新启动后会改变。这使得地方创建EC2实例互相依赖硬得离谱,据我可以告诉使用一个稳定的平台。

Amazon only gives you a certain number of static ip address and the local (private) ips of each EC2 instance can change when the machine is restarted. This makes creating a stable platform where EC2 instances depend on each other ridiculously hard to use as far as I can tell.

我已经在网上搜索了很多关于各种解决方案,到目前为止,没有发现任何合理的外,即使它不是面向公众的分配上不断EC2的弹性IP地址。没有人有任何其他好的想法,实际上是易于执行的?

I've search online a lot about various solutions and so far have found nothing reasonable outside of assigning an elastic ip address on ever EC2 even if its not public facing. Does anyone have any other good ideas that is actually easy to execute on?

谢谢!

查看AWS团队回答问题静态本地IP

See the AWS team's response to question Static local IP:

EC2实例的内部IP地址是通过DHCP分配。上   比如关机,或当DHCP租约到期时,IP地址是   返回到可用于其它地址的一般EC2 DHCP池   实例。

The internal IP address of EC2 instances is allocated via DHCP. On instance shutdown, or when the DHCP lease expires, the IP address is returned to the general EC2 DHCP pool of addresses available for other instances.

有没有办法保证,你将获得相同的DHCP   解决在重新启动后。

There is no way to guarantee that you will obtain the same DHCP address across reboots.

编辑:答案就是使用Amazon VPC。因为现在你控制路由器有不同的额外的设置的一个微不足道的量没有坏处。这是一个世界上除了在AWS上普通的老式EC2实例。这实际上是VPC将启用所有未来的AWS设置默认情况下,如此必要。看到这个帖子的详细资料:<一href="http://www.reddit.com/r/aws/comments/1a3n0r/ec2_update_virtual_private_clouds_for_everyone/">http://www.reddit.com/r/aws/comments/1a3n0r/ec2_update_virtual_private_clouds_for_everyone/

The answer is to use Amazon VPC. There is no downside except a trivial amount of extra setup because now you control the router. It's a world apart from plain old EC2 instance on AWS. It's so necessary in fact that VPC will be enabled for all future AWS setups by default. See this post for more information: http://www.reddit.com/r/aws/comments/1a3n0r/ec2_update_virtual_private_clouds_for_everyone/

推荐答案

股票的答案是:

  1. 使用 AWS VPC 让你有完全控制例如处理
  2. 使用弹性IP地址,这将解决该实例的本地的地址(不公开,如你所期望)时使用EC2实例之间的通信
  1. Use AWS VPC so you have complete control over instance addressing
  2. Use Elastic IPs, which will resolve to the instance's local address (not the public, as you'd expect) when used to communicate between EC2 instances

这篇关于解决方案AWS EC2实例的本地IP变化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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