6 Replies Latest reply on Nov 13, 2012 12:10 PM by Radoslav Husar

    JBoss clustering in Different LANs

    Madhu Repala Newbie

      Hi Everyone.

      I am using JBoss 5.1.0. I could able to setup JBoss Clustering in the sinle Network LAN. and it is working as expected.

      Can someone help me how to setup JBoss clustering in Different LANs. It should work discovery and JMS with the clustering.

        • 1. Re: JBoss clustering in Different LANs
          inspector Newbie

          I'm not familiar with the AS 5, but I think some more information about what you mean with "different LANs" would be helpful. How are the two LANs separeted? Routers or firewalls in between? Maybe Security requirements? Any other special requirements of the network?

          • 2. Re: JBoss clustering in Different LANs
            Madhu Repala Newbie

            Thanks for your reply.


            One network is established with IP 192.168.0.x. And a Router is connected to create a sub-network with IP as 192.168.1.x

            • 3. Re: JBoss clustering in Different LANs
              inspector Newbie

              Ok. As already mentioned, I'm not familiar with the JBoss AS 5. But I think it uses multicast communication as well as the AS 7 does. So configuring the router to pass through ip-multicasts could do the job. On the other hand you should evaluate if this does mess up other network things (Usally you have some reason to use different Subnets).


              Alternative: If the AS 5 uses JGroups you could switch over to the TCP stack and use TCPPING instead of MPING. But I'm not sure if JGroups is used in the AS 5 and if it is you should look if it is used by all the relevant systems, especially JMS. But be warned, depending on you cluster-size the TCP stack can be a bad performance drawback.

              • 4. Re: JBoss clustering in Different LANs
                Madhu Repala Newbie

                Thanks for your suggestions.

                To change JGroup channel protocol i have done following steps. Both the node server started successfully. But JMS is not working properly.


                Node1 (i.e. sent a message to the  Node2 (i.e

                Node2 received message properly. But if Node2 sends a message to Node1, Node1 is not received message. There are no exceptions on console.

                Are there any configurations i am missing.


                I changed PING to TCPPING in the \jboss-5.1.0.GA\server\MasterServer\deploy\cluster\jgroups-channelfactory.sar\META-INF\jgroups-channelfactory-stacks.xml file.

                The same changes i made to both the Nodes.


                Under the tcp section...


                <stack name="tcp"

                           description="TCP based stack, with flow control and message bundling.

                                        TCP stacks are usually used when IP multicasting cannot

                                        be used in a network, e.g. because it is disabled (e.g.

                                        routers discard multicast)">

                                        - - - - - - - -

                                        - - - - - - - -


                <!--  <MPING timeout="3000"




                                   ip_ttl="${jgroups.udp.ip_ttl:2}"/>    -->        

                            <!-- Alternative 2: non multicast-based replacement for MPING. Requires a static configuration

                                 of *all* possible cluster members. -->

                            <TCPPING timeout="3000"






                Under the jbm-data...


                <stack name="jbm-data"

                           description="Stack optimized for the JBoss Messaging Data Channel">

                                        - - - - - - - -

                                        - - - - - - - -

                <!-- <MPING timeout="5000"





                               num_ping_requests="3"/> -->


                               <TCPPING timeout="3000"







                Changed to

                  <attribute name="ControlChannelName">tcp</attribute>

                in \jboss-5.1.0.GA\server\MasterServer\deploy\messaging\mysql-persistence-service.xml file.


                And my start commands are


                run.bat -c MasterServer -b -g MyPartition -u -Djboss.default.jgroups.stack=tcp -Djgroups.tcpping.initial_hosts=[7600],[7600] -Djboss.messaging.ServerPeerID=15

                run.bat -c SlaveServer -b MyPartition -u -Djboss.default.jgroups.stack=tcp -Djgroups.tcpping.initial_hosts=[7600],[7600] -Djboss.messaging.ServerPeerID=26



                Can someone help me by currecting my configurations?

                Thanks in advance.

                • 6. Re: JBoss clustering in Different LANs
                  Radoslav Husar Master

                  These 2 LANs do not pass UDP mutlicast traffic accross -- right?


                  The solution is to use TCP for both discovery and transport (this might have some performance drawbacks) for both clustering and JBM JGroups stacks. You will have to change it in few places, make sure you change all of them (i.e. wasn't there another JBM channel besides data?).


                  PS: there is no really master and slave server

                  PS2: you are missing a space after ip address in the second command

                  PS3: what is -u for if you dont want to use multicast

                  PS4: keep group names small for performance, ideally single character

                  PS5: the real way of solving this, which you cant do atm, is to keep both clusters in the other labs using mutlicat address, but then have the coordinators communicate, typically using TCP -- see JGroups RELAY.