Amazon EC2 hostnames

2019-07-19 11:42发布

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.

2条回答
姐就是有狂的资本
2楼-- · 2019-07-19 12:26

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.

查看更多
你好瞎i
3楼-- · 2019-07-19 12:39

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.

查看更多
登录 后发表回答