Setting up a cluster of domain servers

When you are configuring a domain server, you will find that the clustering subsystem is already part of the main configuration file, domain.xml.

As a matter of fact, the AS7 domain deals with clustering just as a different profile used by the application server. Opening the domain.xml file, you will see that the application server ships with two profiles:

  • The default profile, which can be used for non-clustered environments
  • The ha profile for clustered environments

So, in order to use clustering on a domain, you have at first to configure your server groups to point to the ha profile.

Let’s build an example configuration which uses two server groups:
<server-group name=”main-server-group” profile=”ha”>

<jvm name=”default”>
<heap size=”64m” max-size=”512m”/>
<socket-binding-group ref=”ha-sockets”/>
<server-group name=”other-server-group” profile=”ha”>
<jvm name=”default”>
<heap size=”64m” max-size=”512m”/>
<socket-binding-group ref=”ha-sockets”/>

As highlighted, in the socket-binding-group element, we are referencing the hasockets group, which contains all socket bindings used for a cluster:
<socket-binding-group name=”ha-sockets” default-interface=”public”>
<socket-binding name=”http” port=”8080″/>
<socket-binding name=”https” port=”8443″/>
<socket-binding name=”jgroups-diagnostics” port=”0″ multicastaddress=”″ multicast-port=”7500″/>
<socket-binding name=”jgroups-mping” port=”0″ multicastaddress=”″ multicast-port=”45700″/>
<socket-binding name=”jgroups-tcp” port=”7600″/>
<socket-binding name=”jgroups-tcp-fd” port=”57600″/>

<socket-binding name=”jgroups-udp” port=”55200″ multicastaddress=”″ multicast-port=”45688″/>
<socket-binding name=”jgroups-udp-fd” port=”54200″/>
<socket-binding name=”jmx-connector-registry” port=”1090″/>
<socket-binding name=”jmx-connector-server” port=”1091″/>
<socket-binding name=”jndi” port=”1099″/>
<socket-binding name=”modcluster” port=”0″ multicastaddress=”″ multicast-port=”23364″/>
<socket-binding name=”osgi-http” port=”8090″/>
<socket-binding name=”remoting” port=”4447″/>
<socket-binding name=”txn-recovery-environment” port=”4712″/>
<socket-binding name=”txn-status-manager” port=”4713″/>

Your last effort will be defining the servers that are part of the domain (and of the cluster). To ease our work, we will reuse the same domain server list that is contained in the distribution.


For each server, you have to refer, within your host.xml, to the socket binding group named ha-sockets, which we have just shown:
<server name=”server-one” group=”main-server-group” >
<socket-binding-group ref=”ha-sockets” port-offset=”150″/>
<jvm name=”default”/>

<server name=”server-two” group=”main-server-group” autostart=”
true” >
<socket-binding-group ref=”ha-sockets” port-offset=”250″/>
<jvm name=”default”/>
<server name=”server-three” group=”other-server-group” autostart=”
<socket-binding-group ref=”standard-sockets” portoffset=”
<jvm name=”default”/>

Your clustered domain is ready for running. Launch your domain of servers using the standard batch script (domain.bat/domain.sh) and the server groups will now point to the ha profile and form a cluster of two nodes.

Troubleshooting clustering

The clustering communication is carried out, by default, using UDP and multicasts information around the cluster. If there are problems, typically it is because of one of the following reasons:

  • The nodes are behind a firewall. If your nodes are on different machines then it is possible that the firewall is blocking the multicasts. you can test this by disabling the firewall for each node or adding the appropriate rules.
  • You are using a home network or are behind a gateway. Typically home networks will redirect any UDP traffic to the Internet Service Provider, which is then either dropped by the ISP or just lost. To fix this, you will need to add a route to the firewall/gateway that will redirect any multicast traffic back on to the local network instead.

Actually JGroups ships with two test programs that can be used to test multicast communication: McastReceiverTest and McastSenderTest. Start McastReceiverTest, for example:
java –classpath jgroups-3.0.0.Final.jar
org.jgroups.tests.McastReceiverTest -mcast_addr -port

Then, start McastSenderTest :

java –classpath jgroups-3.0.0.Final.jar
org.jgroups.tests.McastSenderTest -mcast_addr -port 5555


The jgroups-3.0.0.Final.jar can be located in the JBOSS_HOME/modules/org/jgroups/main path of your server distribution

If multicast works correctly, you should be able to type in the McastSenderTest window and see the output in the McastReceiverTest as shown in the following screenshot:

If multicast works correctly, you should be able to type in the McastSenderTest window and see the output in the McastReceiverTest as shown in the following screenshot:


Finally, if you are experiencing troubles with the default multicast address or port, you can change it at any time digging into the jgroups-udp socket binding:

<socket-binding name=”jgroups-udp” port=”55200″ multicastaddress=”${
jboss.default.multicast.address:}” multicastport=”

0 Responses on Setting up a cluster of domain servers"

Leave a Message

Your email address will not be published. Required fields are marked *

Copy Rights Reserved © Mindmajix.com All rights reserved. Disclaimer.