mod_cluster (httpd) doesn't know that the nodes are clustered or not. Usually if you aren't clustered failover will result in errors in the webapps.
Thanks for your reply.
But guide says it supports fail over.
The application server relays lifecycle events (e.g. server startup/shutdown) to the proxies allowing them to effectively auto-configure themselves. Notably, the graceful shutdown of a server will not result in a failover response by a proxy, as is the case with traditional httpd-based load balancers.
Do you know any other way(using other type of connector) to support this requirement?
I read in some guide that we can configure mod_jk in hot-standby/backup worker mode to support failover. Any idea on this apporach?
What do you mean with fail-over response?
hot standby is achieved in mod_cluster by having a node with factor=0 something like:
Dear Naresh, mod_cluster does support failover and load balancing. I'll elaborate on it further. The configuration is fairly straightforward, provided you tell us what are your worker nodes? Tomcat instances? JBoss AS7?
Assuming it's JBoss AS7/Wildfly, you just set:
- sticky-session="true" sticky-session-force="false" -- in this case, there will be failover if the node becomes ill
- sticky-session="true" sticky-session-force="true" -- in this case, there won't be any failover, just load balancing
as attributes to mod-cluster-config element in modcluster subsystem.
Session stickiness is the only thing that concerns mod_cluster as to the actual clustered/non-clustered environment. Apart from this, mod_cluster balancer actually doesn't care whether your workers are clustered or not.
- Use sticky-session="true" sticky-session-force="false", so as to get the failover functionality.
- If your application is not clustered, then in case of failover, your client will fail-over to another worker node that does not posses the client's data (context) that hasn't been persisted to database, i.e. in case of an e-shop, your client will lose his current shopping basket contents.
- If you have your workers clustered, then client won't even know his session failed-over to another worker node.
BTW: Please, refer to mod_cluster Documentation for 1.2.x version, the 1.0 is horribly obsolete.
I suggest using either mod_cluster 1.3.x, or 1.2.8.Final.
Michal Thanks for your reply,
We are using JBoss AS6.2 as woker node and redhat linux 6 as os.
I am implement based on your approach and let you know if any challenges.
One more question does the option 1(sticky-session="true" sticky-session-force="false" ) support load balancing also along with failover.?
Yes it does. (actually session stickiness does not affect loadbalancing as such, it's your load balancing metric that reports worker's load back to the balancer).
Give it a shot.
I am not able to locate following files in Jboss server setup. As part of configuration following files need to be changed.
“server.xml” from “/server/all/deploy/jbossweb.sar/server.xml”
In my jboss setup i only have client folder under path /u01/jboss/jboss-eap-6.2/bin
Dear Naresh, you are looking at very old, legacy instructions that are valid for JBoss AS5 a.k.a. EAP 5.
With JBoss EAP 6.x, look into standalone-ha.xml (or ha profile in domain) and look up modcluster subsystem. All configuration is done there.
I am following below link and tuning it for non-clustered mode in JBoss6.2.
I stuck at point 3 & 4 in section "JBoss side configuration"
I checked standalone.xml but didn't find any listener attribute.
Based on your suggestion configured subsystem in standalone.xml. And httpd proxy is also showing both the node on cluster manager.
But if I shutdown one node, it don't failover to other node but instead it gives below error:-
Service Temporarily Unavailable
The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.
<subsystem xmlns="urn:jboss:domain:modcluster:1.1"> <mod-cluster-config advertise-socket="modcluster" proxy-list="188.8.131.52:10000" sticky-session="true" sticky-session-force="false" connector="ajp"> <dynamic-load-provider> <load-metric type="busyness"/> </dynamic-load-provider> </mod-cluster-config> </subsystem>
Is your issue fixed ? Me too facing the similar problem.