Вопрос

Is it possible for AWS elastic load balancer to forward the incoming request to each of the ec2 instances behind it ?

Это было полезно?

Решение

You can accomplish it in several ways, and the answers can be very long, but my first recommendation would be to bring up another EC2 instance running, for example, Apache Zookeeper. Every other node (the ones you need to "notify") would then run a Zookeeper client, kind of subscribing for an event of "log changed". Whenever you need to change the log level, you would (manually or automatically) trigger a "log changed" event in your Zookeeper node. There is a lot of examples, use cases and code samples in the Zookeper project page that might help you get started.

The reason why I recommended Zookeeper is because it could serve as a central configuration point (not only log level) for your nodes in the future.

Другие советы

For "Command and Control" types of events, you're likely going to want a different mechanism.

You could take the "An SQS Queue for each server" approach, and whichever server gets the web request pushes it to each server's queue. Severs are periodically polling their queue for C&C operations. This gives you guaranteed delivery semantics which are quite important for C&C operations.

Instead of SQS, a database could be used to accomplish (mostly) the same thing. The DB approach is nice as it could also give you audit history which may (or may not) be important.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top