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:
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/domain.sh) and the server groups will now point to the ha profile and form a cluster of two nodes.
Frequently asked Jboss Interview Questions
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:
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 224.10.10.10 -port
5555
Then, start McastSenderTest :
java –classpath jgroups-3.0.0.Final.jar
org.jgroups.tests.McastSenderTest -mcast_addr 224.10.10.10 -port 5555
Note
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:
Name | Dates | |
---|---|---|
JBoss Training | Nov 02 to Nov 17 | View Details |
JBoss Training | Nov 05 to Nov 20 | View Details |
JBoss Training | Nov 09 to Nov 24 | View Details |
JBoss Training | Nov 12 to Nov 27 | View Details |
Ravindra Savaram is a Technical Lead at Mindmajix.com. His passion lies in writing articles on the most popular IT platforms including Machine learning, DevOps, Data Science, Artificial Intelligence, RPA, Deep Learning, and so on. You can stay up to date on all these technologies by following him on LinkedIn and Twitter.