[mod_cluster-dev] mod-cluster and domains with sticky sessions

Paul Ferraro paul.ferraro at redhat.com
Tue Jul 21 09:26:00 EDT 2009

Is the mod_cluster-dev list still not working for you?

On Tue, 2009-07-21 at 14:46 +0200, Bela Ban wrote:
> OK, I read through the archives of this list and came up with a solution 
> for mod-jk, but apparently nobody has so far used domains/sticky 
> sessions with *mod-cluster* !
> I found 2 different ways of doing this:
> #1 server.xml:
> ---------------------
> <Listener className="org.jboss.modcluster.ModClusterListener"
>           advertize="true" domain="${jboss.Domain:DefaultDomain}" />
> #2 and in mod-cluster-jboss-beans.xml:
> ---------------------------------------------------------
> <bean name="HAModClusterService" ...>
>     <property name="domain">${jboss.Domain:DefaultDomain}</property>
> </bean>

Configuration properties for the HA service are defined in a separate
config bean, as documented here:

This should read:

<bean name="HAModClusterService" mode="On Demand"
    <parameter><inject bean="HAPartition"/></parameter>
    <parameter><inject bean="HAModClusterConfig"/></parameter>
    <parameter><inject bean="DynamicLoadBalanceFactorProvider"/></parameter>
    <parameter><bean class="org.jboss.ha.singleton.HASingletonElectionPolicySimple"/></parameter>
<bean name="HAModClusterConfig" mode="On Demand"
  <!-- Configuration properties go here -->
  <parameter name="domain">${jboss.Domain:DefaultDomain}</parameter>

> and then started several instances:
> ./run.sh -b -c all -g *D1* -u -m 10500 
> -Djboss.jvmRoute=*node1* -Djboss.Domain=*D1*
> ./run.sh -b -c all -g *D1* -u -m 10500 
> -Djboss.jvmRoute=*node2* -Djboss.Domain=*D1*
> and
> ./run.sh -b -c all -g *D2* -u -m 11500 
> -Djboss.jvmRoute=*node3* -Djboss.Domain=*D2*
> So we have domains D1 (cluster D1 with node1 and node2) and D2 (cluster 
> D2 with node3).
> #1 above seems to work half way, #2 doesn't.
> Questions
> ========
>     * What is the recommended way of setting of domains ?
>           o I assume #1, but that's not documented anywhere, I just
>             found out accidentally through a port via google

The location of the domain property depends on how you've configured

Config #1 uses ModClusterListener, defined in server.xml, and is primary
used with JBoss Web standalone and Tomcat, where you don't have the
benefit of MC configuration.

Config #2, uses HAModClusterService, configured via the microcontainer,
and is used for configuration in JBoss AS, where all proxy communication
goes through an HASingleton.

The third option, not yet mentioned, uses ModClusterService, configured
via the microcontainer, where each AS node communicates directly with
the proxy.  Using this method, the "domain" property is defined within
the ModClusterService bean, like you tried to do initially.

>     * Sometimes, a webapp on node2 fails over to node3 rather than node1

Have you verified that node1 is enabled when this happens?
If so, can you file a JIRA?

> Can someone look into this ? This information should be available via a 
> web page, similar to the one for mod-jk !

Is this what you're looking for?

More information about the mod_cluster-dev mailing list