Setting up a cluster of domain servers

  • (4.0)

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
Inclined to build a profession as JBOSS Developer? Then here is the blog post on JBOSS TRAINING ONLINE.

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

As highlighted, in the socket-binding-group element, we are referencing the hasockets group, which contains all socket bindings used for a cluster:

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:

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

Frequently asked Jboss Interview Questions

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:

Explore Jboss Sample Resumes! Download & Edit, Get Noticed by Top Employers!Download Now!


Popular Courses in 2018

Get Updates on Tech posts, Interview & Certification questions and training schedules