2

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.

John Rotenstein
  • 241,921
  • 22
  • 380
  • 470
DThompson55
  • 111
  • 2
  • 14
  • Look at using VPC, you will have control of IP addresses in that environment. If you can't use VPC, you can also use elastic IPs, which will provide a static dns name to access your instance. – datasage Sep 16 '13 at 20:27
  • Thanks for the quick response. We'll look at VPC. We can't rely on elastic IP on Classic because the internal private IP and host names still change even eith elastic IP. But hopefully VPC will solve the problem. – DThompson55 Sep 16 '13 at 20:42
  • If you use the public DNS name, it will resolve to the private IP internally within AWS. – datasage Sep 16 '13 at 20:47
  • That's what we thought too, but for some reason after creating a WAS profile using the public DNS name and restarting, WAS didn't resolve to the internal IP on startup. So that's when we started looking at different options. But maybe we did something wrong in the conf. – DThompson55 Sep 16 '13 at 20:57

2 Answers2

2

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.

David Levesque
  • 22,181
  • 8
  • 67
  • 82
  • Thank you. I associated the EIP with my instance. Then I pointed my DNS to the new IP and set the fully qualified hostname using my domain name to that IP. Then I set the internal hostname to match my FQHN in the /etc/rc.local file and restarted, which gave WAS a proper hostname. I am still concerned that traffic between my servers on EC2 will not be internal to EC2, since they are using domain names defined outside of EC2, but if you're saying there's some magic that EC2 does, then I guess it'll be OK. But I still need to verify that. – DThompson55 Sep 20 '13 at 19:36
0

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.

user3098199
  • 31
  • 1
  • 5
  • Please add your explanation about the other answer as a comment and then post your answer in a proper way. – Ean V Feb 12 '14 at 06:34