-
1. Re: How to configure load balancer and failover using mod_cluster in non-clustered?
jfclere May 2, 2014 4:27 AM (in response to nareshsoni02)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.
-
2. Re: How to configure load balancer and failover using mod_cluster in non-clustered?
nareshsoni02 May 2, 2014 5:58 AM (in response to jfclere)Thanks for your reply.
But guide says it supports fail over.
http://docs.jboss.org/mod_cluster/1.0.0/html_single/
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?
-
3. Re: How to configure load balancer and failover using mod_cluster in non-clustered?
jfclere May 2, 2014 6:18 AM (in response to nareshsoni02)What do you mean with fail-over response?
hot standby is achieved in mod_cluster by having a node with factor=0 something like:
<simple-load-provider factor="0"/>
-
4. Re: How to configure load balancer and failover using mod_cluster in non-clustered?
mbabacek May 2, 2014 6:27 AM (in response to nareshsoni02)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
or
- 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.
I suggest:
- 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.
-
5. Re: How to configure load balancer and failover using mod_cluster in non-clustered?
nareshsoni02 May 2, 2014 8:44 AM (in response to mbabacek)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.?
-
6. Re: How to configure load balancer and failover using mod_cluster in non-clustered?
mbabacek May 2, 2014 9:00 AM (in response to nareshsoni02)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.
-
7. Re: How to configure load balancer and failover using mod_cluster in non-clustered?
nareshsoni02 May 13, 2014 8:08 AM (in response to mbabacek)Hi Michal,
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”
/server/all/deploy/jbossweb.sar/META-INF/jboss-beans.xml
In my jboss setup i only have client folder under path /u01/jboss/jboss-eap-6.2/bin
-
8. Re: How to configure load balancer and failover using mod_cluster in non-clustered?
mbabacek May 13, 2014 8:15 AM (in response to nareshsoni02)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.
-
9. Re: How to configure load balancer and failover using mod_cluster in non-clustered?
nareshsoni02 May 13, 2014 9:10 AM (in response to mbabacek)Michal,
I am following below link and tuning it for non-clustered mode in JBoss6.2.
http://middlewaremagic.com/jboss/?p=147
I stuck at point 3 & 4 in section "JBoss side configuration"
I checked standalone.xml but didn't find any listener attribute.
-
10. Re: How to configure load balancer and failover using mod_cluster in non-clustered?
nareshsoni02 May 14, 2014 8:07 AM (in response to nareshsoni02)Hi Michal,
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="153.154.89.81:10000" sticky-session="true" sticky-session-force="false" connector="ajp"> <dynamic-load-provider> <load-metric type="busyness"/> </dynamic-load-provider> </mod-cluster-config> </subsystem> -
11. Re: How to configure load balancer and failover using mod_cluster in non-clustered?
arun2arunraj Dec 10, 2014 9:07 PM (in response to nareshsoni02)Hi Naresh,
Is your issue fixed ? Me too facing the similar problem.Regards,
ArunRaj. R