Amazon EC2 hostnames

落爺英雄遲暮 提交于 2019-12-11 02:28:14

问题


I am trying to configure WAS 8.5 on EC2, but what I find is that the EC2 hostname changes on each restart. So basically, I've created a WAS instance on ec2-54-200-56-168.us-west-2.compute.amazonaws.com, and then after restart the server (and IP of course) changes to ec2-54-200-55-7.us-west-2.compute.amazonaws.com

Of course WAS needs the hostname in its cell configuration. But also, if the host names keep changing I don't understand how to set up two servers to talk to each other.


回答1:


You can associate an Elastic IP with your EC2 instance. This will give it a fixed IP address, as well as a public DNS that doesn't change after restart.




回答2:


The solution from David is not correct. The Elastic IP (and hostname) change in EC2 Classic (non VPC), so it won't do the trick. The IP/hostname with EC2 classic will change after each stop/reboot.

The only solution I think would work is to use the VPC, and then use an Elastic IP, which persists for the lifetime of an instance.



来源:https://stackoverflow.com/questions/18836503/amazon-ec2-hostnames

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