mercredi 15 avril 2015

PHP - Amazon EBS - Get private IP address

I am hosting a web app in amazon EBS. The web app is written in php. The EBS also features ELB. The web app implements a websocket with the client. Here is what I have done so far:



  1. I know I have to listen to the private ip of the instance for this to work

  2. implemented a listener in load balancer to connect instance port to EBS port

  3. opened inbound and outbound traffic for the port in security groups.


If the ELB goes for horizontal scaling (increase the number of instances), will the private ips of the scaled instances remain same (please explain)? If not, and I believe so, how do I get the private ip address of the current instance that is serving the client?


So far its working perfectly without any problem, but there's only one instance running. I tried listing the clients and I can get the private ips with the list but I don't know how to identify the instance that is currently serving the file.


Please help me.





Aucun commentaire:

Enregistrer un commentaire