Good question. This topic deserves a wiki page of its own.
Simplest way to solve your problem:
1) Include the following in your command line args that you pass to JBoss:
-Djboss.default.jgroups.stack=tcp
That will change most of the services that use a JGroups channel to use one based on the
"tcp" stack instead of the default "udp" stack.
2) The actual JGroups configurations for the "tcp" stack and the "udp"
stack are found in the
deploy/cluster/jgroups-channelfactory.sar/META-INF/jgroups-channelfactory-stacks.xml file.
For more on the service that configures, see [1]
You can't use multicast, but the "tcp" config actually uses multicast for
it's peer-discovery function. It does this because not using multicast requires
configuring the addresses/ports of all the possible nodes in the cluster, which is of
course environment-specific and doesn't just work out of the box. But, the
"tcp" config in jgroups-channelfactory-stacks.xml tries to help. It includes two
discovery protocol configurations, one "MPING" that is uncommented and one
"TCPPING" that is commented. You need to comment out MPING and uncommment
TCPPING.
For more on MPING and TCPPING see [2] and [3].
3) As noted above, not using multicast requires configuring the addresses/ports of all the
possible nodes in the cluster. You need to compile this information. The port is the value
of the "tcp" stack's TCP.start_port configuration, by default 7600. The
address for each node is usually the value you pass to -b when you start JBoss; can also
be the value you assign to -Djgroups.bind_addr if you're using that technique to tell
JGroups to use a different interface than the -b one. You can also use hostnames instead
of addresses.
Gather all these into a comma-delimited list and pass them to JBoss at startup via a
system property:
-Djgroups.tcpping.initial_hosts=192.168.0.100:7600,192.168.0.101:7600,192.168.0.102:7600
4) If you are running clustered JBoss Messaging, JBM has their own UDP multicast-based
JGroups config they use. You'll need to change that to use the "tcp" config.
This is configured in the deploy/messaging/XXX-persistence-service.xml file. (The value of
XXX will depend on what RDBMS you are using for message persistence.) Change:
| <mbean code="org.jboss.messaging.core.jmx.MessagingPostOfficeService"
...>
|
| . . .
|
| <attribute
name="ControlChannelName">jbm-control</attribute>
|
| . . .
| </mbean>
|
to
| <mbean code="org.jboss.messaging.core.jmx.MessagingPostOfficeService"
...">
|
| . . .
|
| <attribute name="ControlChannelName">tcp</attribute>
|
| . . .
| </mbean>
|
[1]
http://www.jboss.org/community/wiki/JGroupsChannelFactoryandSharedTranspo...
[2]
http://www.jboss.org/community/docs/DOC-10897
[3]
http://www.jboss.org/community/docs/DOC-10915
View the original post :
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4240430#...
Reply to the post :
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&a...