Tuesday, April 14, 2009


Using Tomcat with mod_heartmonitor (part 2)

This is the second blog on the topic using Tomcat with mod_heartmonitor, here it is using HTTP instead multicast sockets... Well no one like multicast sockets but everyone likes the HTTP protocol no?
In the httpd.conf file add something like the following (to the httpd.conf the previous blog):

<Location /HeartbeatListener>
SetHandler hearthbeat
Order deny,allow
Deny from all
Allow from
Allow from

In the server.xml add ProxyList to the HeartbeatListener:

<Listener className="org.apache.catalina.ha.backend.HeartbeatListener" Port="8009" ProxyList="" />

Have fun!!!

Thursday, April 09, 2009


Using Tomcat with mod_heartmonitor

httpd-trunk contains a logic to receive hearth beats for backend servers.
Associated with mod_proxy_balancer and the heartbeat Load balancing scheduler algorithm you can have a partially dynamic load balancing behaviour.
Configure httpd.conf with something like the following: (using httpd-trunk).

LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
LoadModule heartmonitor_module modules/mod_heartmonitor.so
LoadModule lbmethod_heartbeat_module modules/mod_lbmethod_heartbeat.so
LoadModule lbmethod_byrequests_module modules/mod_lbmethod_byrequests.so

ProxyPass /myapp balancer://mycluster/myapp lbmethod=heartbeat
HeartbeatStorage logs/hb.dat

<Proxy balancer://mycluster>
BalancerMember ajp:// route=jfpc ping=10
BalancerMember ajp:// route=neo3 ping=10

Add the listener in server.xml of each tomcat: (using tc_trunk):

<Listener className="org.apache.catalina.ha.backend.HeartbeatListener" Port="8009"/>

Port is the Port of the AJP Connector where httpd is going to proxy the requests.

Start httpd and the Tomcats and have fun with the "dynamic" cluster.

This page is powered by Blogger. Isn't yours?