mod_cluster and Proxypass directives for hosts that are down results in 503 error
ishai Dec 22, 2011 10:44 AMDear mod_cluster community member
I am facing the following issue after switching from mod_jk 1.2.31 to mod_cluster 1.1.2 (could not work with 1.1.3 due to the this issue) on Apache 2.2.17 RHEL: JK set-up works OK even if one or multiple reverse proxied hosts are down. With mod_cluster 503 error is reported if some of the reverse proxied hosts are unavailable or non-responsive. Commenting out such reverse proxy directives restores the system to its normal behavior. In both scenarious same cluster of 2 JBoss 5.1.0.GA machines is utilized.
As much as I enjoyed working with mod_cluster and its seemless configuration I am at the brink of going back to mod_jk. Any help will be greatly appreciated.
Irena
In the configrations below host1 is down and the application on host2 is not responsive
JK configuration
httpd.conf
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
LoadModule jk_module modules/mod_jk-1.2.31-httpd-2.2.x.so
JkWorkersFile /etc/httpd/conf/workers.properties
JkShmFile /var/log/httpd/mod_jk.shm
JkLogFile /var/log/httpd/mod_jk.log
JkLogLevel info
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
JkMount /jboss-content-1/* jboss
JkMount /jboss-content-1* jboss
JkMount /jboss-content-2/* jboss
JkMount /jboss-content-2* jboss
...
ProxyPass /content1/ http://host1/content1/
ProxyPassReverse /content1/ http://host1/content1/
ProxyPass /content2/ https://host2/content2/
ProxyPassReverse /content2/ https://host2/content2/
ProxyPass /content3/ http://host3/content1/
ProxyPassReverse /content3/ http://host3/content1/
workers.properties
worker.list=jboss
worker.worker1.port=8009
worker.worker1.host=jboss-1
worker.worker1.type=ajp13
worker.worker1.lbfactor=1
worker.worker1.ping_mode=A
worker.worker1.fail_on_status=400,404,500,503
worker.worker1.recovery_options=28
worker.worker2.port=8009
worker.worker2.host=jboss-2
worker.worker2.type=ajp13
worker.worker2.lbfactor=1
worker.worker2.ping_mode=A
worker.worker2.fail_on_status=400,404,500,503
worker.worker2.recovery_options=28
# Define the LB worker
worker.jboss.type=lb
worker.jboss.balance_workers=worker1,worker2
worker.jboss.sticky_session=1
mod_cluster configuration
httpd.conf
# MOD CLUSTER - START
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
LoadModule slotmem_module modules/mod_slotmem.so
LoadModule manager_module modules/mod_manager.so
LoadModule proxy_cluster_module modules/mod_proxy_cluster.so
#LoadModule advertise_module modules/mod_advertise.so
#LoadModule proxy_module modules/mod_proxy.so
#LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
Listen *:7777
<VirtualHost *:7777>
<Directory />
Order deny,allow
Deny from all
Allow from some.ip
</Directory>
CreateBalancers 0
KeepAliveTimeout 60
MaxKeepAliveRequests 0
LogLevel debug
ProxyPassMatch / !
</VirtualHost>
# MOD CLUSTER - END
...
ProxyPass /content1/ http://host1/content1/
ProxyPassReverse /content1/ http://host1/content1/
ProxyPass /content2/ https://host2/content2/
ProxyPassReverse /content2/ https://host2/content2/
ProxyPass /content3/ http://host3/content1/
ProxyPassReverse /content3/ http://host3/content1/