/Apache2-->Tomcat 7 / ---node1-- / http / https/http --> ApacheLoadBalancer [mod_proxy_http] \ \ http \ \ \Apahe2-->Tomcat 7 ---node2--- .......mode nodes ...
At present I’m using Apache load balancer
mod_proxy_http to balance load between two nodes where each nodes front tomcat7 with apache2 , basically I’m load balancing two Apache nodes .
In any of these nodes if tomcat stop/fail for any reason I would like to stop Apache in that node so that load balancer identify the node is not available distribute the load . At present even when tomcat is down in any node since Apache is up(Apache front the tomcat in each node ) load balancer think this node still available and sends requests.. and eventually fail .
is there are a way to stop Apache in particular node if backend tomcat fails.
One way I thought doing this is to run cron job(keep checking) or Linux script so that when tomcat down I can stop Apache, trying to find out is there a more neat way of doing this ? any ideas . Thanks .
Please note we do use Apache in each node without directly exposing tomcat to load balancer for many reasons One of which is we do use mod proxy again inside fronting Apache to navigate to different tomcat pools
if I narrow down my question unless you have better suggestion . Q: Is there a cleaner way to stop or send signal to fronting Apache2 when backend tomcat is down/fail .
Note : Direct communication between balancer and Tomcat should solve it i know but circumstances are different .