How to find the IP address of an amazon EC2 instance on reboot

前端 未结 10 1329
长发绾君心
长发绾君心 2020-12-12 13:50

On reboot, the IP address of an amazon instance changes. How to find the new IP address using java API?

10条回答
  •  误落风尘
    2020-12-12 14:08

    Assuming your rebooting the instance and not launching from scratch than you can assign an elastic IP which always remains with the ec2 instance(unless you move the IP to another server). This allows you to point all your DNS to that one IP and not worry that a reboot will cause you issues.

    I think thats what your asking but there are other things you could be asking. The internal IP of the server changes(if you relaunch the instance not reboot) and you can't 'reserve' it so you may need to create a script to keep you the new IP(if your pointing internal services to it).

    hope that helps

提交回复
热议问题