How to test multicast using JGroups in JBoss EAP 4, 5, 6, or 7?
Environment
- Red Hat JBoss Enterprise Application Platform (EAP)
- 4.x
- 5.x
- 6.x
- 7.x
Issue
- How to test whether the multicast address is working correctly using the JGroups?
- Is it possible to check whether the multicast address is working properly using the JGroups?
Resolution
Below examples are for demonstration purposes only.
JBoss EAP 6.1+ and 7
Follow the below steps from the location of the jgroups jar on two nodes.
-
For a more accurate test, set mcast_addr and port to the values which are going to be used for cluster communication.
-
Step-1. On one node, run the multicast receiver:
java -cp $JBOSS_HOME/bin/client/jboss-client.jar org.jgroups.tests.McastReceiverTest -mcast_addr 230.11.11.11 -port 5555Here above IP address are used for example only.
-
Step-2. On the other node, run the multicast sender:
java -cp $JBOSS_HOME/bin/client/jboss-client.jar org.jgroups.tests.McastSenderTest -mcast_addr 230.11.11.11 -port 5555Here above IP address are used for example only.
-
Step-3. On the instance sending packets (#2), enter information (random text/characters) followed by pressing enter.
- Observe whether the message sent by the sender instance is being echoed(received) by the receiver(#1) or not.
- Send several packets, as sometimes the network will work for one packet, but then drop the rest.
-
Step-4. Repeat step 1-3 for each combination of sender and receiver, as there may be a misconfiguration only for specific instances.
If all the data entered from sender(#2) is not being received(echoed) on receiver(#1) for each test, then multicast is not configured correctly in the operating system or the network.
JBoss EAP 6.0.x
The JGroups jars shipped in EAP 6.0 and 6.0.1 do not contain the test classes described in this article. However, get the jboss-client.jar or jgroups*.jar from JBoss EAP 6.1 or later and then follow the test-case directions which are mentioned above for JBoss EAP 6.1.x. The jgroups*.jar from JBoss EAP 6.1 is attached to this article.
JBoss EAP 5.x
Follow the below steps from the location of the jgroups jar on two nodes.
-
The bind_addr should be set to the appropriate IP for the instance.
-
For a more accurate test, set mcast_addr and port to the values which is going to be used for cluster communication.
-
Step-1. On one node, run the multicast receiver:
java -cp $JBOSS_HOME/server/production/lib/jgroups.jar org.jgroups.tests.McastReceiverTest -mcast_addr 230.11.11.11 -port 5555 -bind_addr $YOUR_BIND_ADDRESS
Here above IP address are used for example only.
- Step-2. On the other node, run the multicast sender:
java -cp $JBOSS_HOME/server/production/lib/jgroups.jar org.jgroups.tests.McastSenderTest -mcast_addr 230.11.11.11 -port 5555 -bind_addr $YOUR_BIND_ADDRESS
Here above IP address are used for example only.
-
Step-3. On the instance sending packets (#2), enter information (i.e., random text/characters) followed by pressing enter.
- Observe whether the message sent by the sender instance is being echoed(received) by the receiver(#1) or not.
- Send several packets, as sometimes the network will work for one packet, but then drop the rest.
-
Step-4. Repeat step 1-3 for each combination of sender and receiver, as there may be a misconfiguration only for specific instances.
If all the data entered from sender(#2) is not being received(echoed) on receiver(#1) for each test, then multicast is not configured correctly in the operating system or the network.
For alternative methods of testing multicast, see How do I test whether multicast works in my environment?
Note: To mimic the ttl used by JGroups within JBoss, one can set the ttl on the sender (-ttl X) to the value (ip_ttl) specified inside the jgroups-channelfactory-stacks.xml configuration. This is usually 2 by default.
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.