0

I have a spring-boot service set up in Elastic Beanstalk. I need to call an end point on each of the nodes in the service but all I know is the end point with load balancer's hostname.

  1. How can I ensure that each node gets called? Is there a way to do that?
  2. If so, how can I ensure that the nodes could be called in a rolling fashion - i.e. first 1/4th of the nodes are called, and then the next 1/4th of the nodes and so on?
Nik
  • 5,515
  • 14
  • 49
  • 75
  • 4
    I don't think there is a out of the box solution to this. You may end-up developing something of your own. In case you need some suggestions can you share some more context. Does the API echo back the hostname? Can you access the instances from where you want invoke the API(using ip:port)? Can you query the load balancer details using aws sdk? – Shibashis May 16 '16 at 02:57
  • I can access the instances by looking up their IP addresses from EC2 management portal. But that is a manual process and the hosts would change based on the amount of traffic the service receives. So can't automate that part. I need to call that end point to trigger a data refresh and that needs to be done across all nodes. I am not sure whether I can get the hostnames (or IPs) of all hosts by querying the load balancer. But thanks for the suggestion. If this can be accomplished, I can individually call the end points. Will investigate this option. – Nik May 16 '16 at 16:54
  • 2
    You can get the instance Ids from the load balancer and then get the corresponding IPs. You should be able to access the services using . In case you are running inside a vpc, the script has to execute within the private subnet. Of course you will have use some scripting, you will need to use aws cli with shell scripting. – Shibashis May 16 '16 at 16:59

0 Answers0