Send a request to all machines behind an AWS ELB

末鹿安然 提交于 2019-12-25 06:06:06

问题


I have n Endpoints behind an AWS Elastic Load Balancer, and I want to make a REST Call to everyone of those machines. If I make this call directly to the ELB, it will call just one of the machines. So my question is there a way yo make it? Maybe a specific AWS ELB Api that I can use, or some configuration I don't know. Before you suggest: I can not change the REST to anything else, I have no control over the application.


回答1:


You'll have to bypass the load balancer to do this. You could write something to query the AWS API for all the instances connected to the load balancer and get their external IP addresses, and then call the REST endpoint on each machine.

Also, the machines behind the load balancer would need a security group configuration that allows you to send requests to them without going through the load balancer.

Are these instances in an Auto Scaling group? If an auto scaling event occurs while you are in the middle of calling these REST endpoints you could either end up having some requests fail, or you could end up missing the REST call on any new instances.

Obviously there are much more elegant ways to handle this sort of communication to multiple instances, but you would need to be able to modify the code running on those instances.



来源:https://stackoverflow.com/questions/32701738/send-a-request-to-all-machines-behind-an-aws-elb

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!