Is there any way to send a http request to all instances in a AWS ELB? [closed]

折月煮酒 提交于 2019-12-10 10:55:59

问题


I will make an array of Varnish servers using Amazon Auto Scaling. With that, I'll have to send a purge request to all servers that are as healthy on the load balancer.

It is possible? What is the easiest way to do? Should I use API?


回答1:


That's fairly straightforward using awscli / API.

  1. Get healthy instance IDs from ELB using aws elb describe-instance-health. Lots of examples here: AWS CLI - elb describe-instance-health

  2. Get IP addresses of your healthy instances by using aws ec2 describe-instances. Docs here: AWS CLI - ec2 describe-instances

  3. Once you have IP addresses just do what is needed on your EC2 instances (make sure your security groups are set up properly).



来源:https://stackoverflow.com/questions/30445647/is-there-any-way-to-send-a-http-request-to-all-instances-in-a-aws-elb

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