6 Replies Latest reply on Mar 12, 2005 4:12 PM by Ashit Kumar

    Help required setting up TCP based cluster

    mondrejko Newbie

      I am attempting to setup a simple two-node cluster using TCP/TCPPING on JBoss 3.2.3 (currently on Windows 2000, but we also develop for Linux and Solaris). Unfortunately, the nodes are not finding each other with my current cluster configuration (I have the nodes successfully finding each other using UDP).

      I have read through the JBoss clustering document and the documentation on JGroups.org and believe that I have a reasonable configuration setup in cluster-server.xml. But, obviously not quite correct. The server log on startup for both nodes contains (seemingly indicating that the nodes do not know of one another):

      14:49:08,549 INFO [DefaultPartition] Initializing
      14:49:12,237 INFO [ClusterPartition] Starting channel
      14:49:12,252 INFO [DefaultPartition] Number of cluster members: 1
      14:49:12,252 INFO [DefaultPartition] Other members: 0
      14:49:20,268 INFO [ClusterPartition] Started ClusterPartition: DefaultPartition
      14:49:20,284 INFO [ClusterPartition] Started jboss:service=DefaultPartition


      Also, when the node that an EJB client is connected to is taken down, upon next access the client receives a service unavailable exception (rather than the request switching to the alternate node).

      Any help would be appreciated. Below is my cluster-service.xml config file used on both nodes- this is derived pretty much from the tcp.xml file included in jgroups.jar.

      Thanks,
      Michael

      cluster-service.xml
      ----------------------

      <?xml version="1.0" encoding="UTF-8"?>
      
      <server>
      
       <classpath codebase="lib" archives="jbossha.jar"/>
      
       <!-- ==================================================================== -->
       <!-- Cluster Partition: defines cluster -->
       <!-- ==================================================================== -->
      
       <mbean code="org.jboss.ha.framework.server.ClusterPartition"
       name="jboss:service=DefaultPartition">
      
       <!-- Name of the partition being built -->
       <attribute name="PartitionName">DefaultPartition</attribute>
       <!-- Determine if deadlock detection is enabled -->
       <attribute name="DeadlockDetection">False</attribute>
       <!-- The JGroups protocol configuration -->
       <attribute name="PartitionConfig">
       <Config>
       <TCP
       start_port="7800"
       bind_addr="localhost"
       loopback="true"
       />
       <TCPPING
       initial_hosts="10.1.1.162[7800],10.1.1.15[7800]"
       num_initial_members="2"
       port_range="5"
       timeout="3000"
       />
       <FD
       timeout="2500"
       max_tries="5"
       />
       <VERIFY_SUSPECT
       timeout="3000"
       num_msgs="3"
       />
       <pbcast.NAKACK
       gc_lag="100"
       retransmit_timeout="600,1200,2400,4800"
       />
       <pbcast.STABLE
       desired_avg_gossip="20000"
       max_bytes="0"
       stability_delay="1000"
       up_thread="false"
       down_thread="false"
       />
       <pbcast.GMS
       join_timeout="5000"
       join_retry_timeout="2000"
       shun="true"
       print_local_addr="false"
       />
       </Config>
       </attribute>
       </mbean>
      
       <!-- ==================================================================== -->
       <!-- HA Session State Service for SFSB -->
       <!-- ==================================================================== -->
      
       <mbean code="org.jboss.ha.hasessionstate.server.HASessionStateService"
       name="jboss:service=HASessionState">
       <depends>jboss:service=DefaultPartition</depends>
       <!-- Name of the partition to which the service is linked -->
       <attribute name="PartitionName">DefaultPartition</attribute>
       <!-- JNDI name under which the service is bound -->
       <attribute name="JndiName">/HASessionState/Default</attribute>
       <!-- Max delay before cleaning unreclaimed state.
       Defaults to 30*60*1000 => 30 minutes -->
       <attribute name="BeanCleaningDelay">0</attribute>
       </mbean>
      
       <!-- ==================================================================== -->
       <!-- HA JNDI -->
       <!-- ==================================================================== -->
      
       <mbean code="org.jboss.ha.jndi.HANamingService"
       name="jboss:service=HAJNDI">
       <depends>jboss:service=DefaultPartition</depends>
       <!-- Name of the partition to which the service is linked -->
       <attribute name="PartitionName">DefaultPartition</attribute>
       <!-- bind address of HA JNDI RMI endpoint -->
       <attribute name="BindAddress">${jboss.bind.address}</attribute>
       <!-- RmiPort to be used by the HA-JNDI service
       once bound. 0 => auto. -->
       <attribute name="RmiPort">0</attribute>
       <!-- Port on which the HA-JNDI stub is made available -->
       <attribute name="Port">1100</attribute>
       <!-- Backlog to be used for client-server RMI
       invocations during JNDI queries -->
       <attribute name="Backlog">50</attribute>
      
       <!-- Multicast Address and Group used for auto-discovery -->
       <!-- Uncomment AutoDiscovery attributes for auto-discovery
       -->
       <attribute name="AutoDiscoveryAddress">230.0.0.4</attribute>
       <attribute name="AutoDiscoveryGroup">1102</attribute>
      
       <!-- IP Address to which should be bound: the Port, the RmiPort and
       the AutoDiscovery multicast socket. -->
       <!-- Client socket factory to be used for client-server
       RMI invocations during JNDI queries -->
       <!--attribute name="ClientSocketFactory">custom</attribute-->
       <!-- Server socket factory to be used for client-server
       RMI invocations during JNDI queries -->
       <!--attribute name="ServerSocketFactory">custom</attribute-->
       </mbean>
      
       <mbean code="org.jboss.invocation.jrmp.server.JRMPInvokerHA"
       name="jboss:service=invoker,type=jrmpha">
       <attribute name="ServerAddress">${jboss.bind.address}</attribute>
       <!--
       <attribute name="RMIObjectPort">0</attribute>
       <attribute name="RMIClientSocketFactory">custom</attribute>
       <attribute name="RMIServerSocketFactory">custom</attribute>
       -->
       </mbean>
      
       <!-- ==================================================================== -->
       <!-- Distributed cache invalidation -->
       <!-- ==================================================================== -->
      
       <mbean code="org.jboss.cache.invalidation.bridges.JGCacheInvalidationBridge"
       name="jboss.cache:service=InvalidationBridge,type=JavaGroups">
       <depends>jboss:service=DefaultPartition</depends>
       <depends>jboss.cache:service=InvalidationManager</depends>
       <attribute name="InvalidationManager">jboss.cache:service=InvalidationManager</attribute>
       <attribute name="PartitionName">DefaultPartition</attribute>
       <attribute name="BridgeName">DefaultJGBridge</attribute>
       </mbean>
      
      </server>
      


        • 1. Help required setting up TCP based cluster
          Bela Ban Master

          I am attempting to setup a simple two-node cluster using TCP/TCPPING on JBoss 3.2.3 (currently on Windows 2000, but we also develop for Linux and Solaris). Unfortunately, the nodes are not finding each other with my current cluster configuration (I have the nodes successfully finding each other using UDP).

          I have read through the JBoss clustering document and the documentation on JGroups.org and believe that I have a reasonable configuration setup in cluster-server.xml. But, obviously not quite correct. The server log on startup for both nodes contains (seemingly indicating that the nodes do not know of one another):

          14:49:08,549 INFO [DefaultPartition] Initializing
          14:49:12,237 INFO [ClusterPartition] Starting channel
          14:49:12,252 INFO [DefaultPartition] Number of cluster members: 1
          14:49:12,252 INFO [DefaultPartition] Other members: 0
          14:49:20,268 INFO [ClusterPartition] Started ClusterPartition: DefaultPartition
          14:49:20,284 INFO [ClusterPartition] Started jboss:service=DefaultPartition


          Also, when the node that an EJB client is connected to is taken down, upon next access the client receives a service unavailable exception (rather than the request switching to the alternate node).

          Any help would be appreciated. Below is my cluster-service.xml config file used on both nodes- this is derived pretty much from the tcp.xml file included in jgroups.jar.

          Thanks,
          Michael

          cluster-service.xml
          ----------------------

          <?xml version="1.0" encoding="UTF-8"?>
          
          <server>
          
           <classpath codebase="lib" archives="jbossha.jar"/>
          
           <!-- ==================================================================== -->
           <!-- Cluster Partition: defines cluster -->
           <!-- ==================================================================== -->
          
           <mbean code="org.jboss.ha.framework.server.ClusterPartition"
           name="jboss:service=DefaultPartition">
          
           <!-- Name of the partition being built -->
           <attribute name="PartitionName">DefaultPartition</attribute>
           <!-- Determine if deadlock detection is enabled -->
           <attribute name="DeadlockDetection">False</attribute>
           <!-- The JGroups protocol configuration -->
           <attribute name="PartitionConfig">
           <Config>
           <TCP
           start_port="7800"
           bind_addr="localhost"
           loopback="true"
           />
           <TCPPING
           initial_hosts="10.1.1.162[7800],10.1.1.15[7800]"
           num_initial_members="2"
           port_range="5"
           timeout="3000"
           />
           <FD
           timeout="2500"
           max_tries="5"
           />
           <VERIFY_SUSPECT
           timeout="3000"
           num_msgs="3"
           />
           <pbcast.NAKACK
           gc_lag="100"
           retransmit_timeout="600,1200,2400,4800"
           />
           <pbcast.STABLE
           desired_avg_gossip="20000"
           max_bytes="0"
           stability_delay="1000"
           up_thread="false"
           down_thread="false"
           />
           <pbcast.GMS
           join_timeout="5000"
           join_retry_timeout="2000"
           shun="true"
           print_local_addr="false"
           />
           </Config>
           </attribute>
           </mbean>
          
           <!-- ==================================================================== -->
           <!-- HA Session State Service for SFSB -->
           <!-- ==================================================================== -->
          
           <mbean code="org.jboss.ha.hasessionstate.server.HASessionStateService"
           name="jboss:service=HASessionState">
           <depends>jboss:service=DefaultPartition</depends>
           <!-- Name of the partition to which the service is linked -->
           <attribute name="PartitionName">DefaultPartition</attribute>
           <!-- JNDI name under which the service is bound -->
           <attribute name="JndiName">/HASessionState/Default</attribute>
           <!-- Max delay before cleaning unreclaimed state.
           Defaults to 30*60*1000 => 30 minutes -->
           <attribute name="BeanCleaningDelay">0</attribute>
           </mbean>
          
           <!-- ==================================================================== -->
           <!-- HA JNDI -->
           <!-- ==================================================================== -->
          
           <mbean code="org.jboss.ha.jndi.HANamingService"
           name="jboss:service=HAJNDI">
           <depends>jboss:service=DefaultPartition</depends>
           <!-- Name of the partition to which the service is linked -->
           <attribute name="PartitionName">DefaultPartition</attribute>
           <!-- bind address of HA JNDI RMI endpoint -->
           <attribute name="BindAddress">${jboss.bind.address}</attribute>
           <!-- RmiPort to be used by the HA-JNDI service
           once bound. 0 => auto. -->
           <attribute name="RmiPort">0</attribute>
           <!-- Port on which the HA-JNDI stub is made available -->
           <attribute name="Port">1100</attribute>
           <!-- Backlog to be used for client-server RMI
           invocations during JNDI queries -->
           <attribute name="Backlog">50</attribute>
          
           <!-- Multicast Address and Group used for auto-discovery -->
           <!-- Uncomment AutoDiscovery attributes for auto-discovery
           -->
           <attribute name="AutoDiscoveryAddress">230.0.0.4</attribute>
           <attribute name="AutoDiscoveryGroup">1102</attribute>
          
           <!-- IP Address to which should be bound: the Port, the RmiPort and
           the AutoDiscovery multicast socket. -->
           <!-- Client socket factory to be used for client-server
           RMI invocations during JNDI queries -->
           <!--attribute name="ClientSocketFactory">custom</attribute-->
           <!-- Server socket factory to be used for client-server
           RMI invocations during JNDI queries -->
           <!--attribute name="ServerSocketFactory">custom</attribute-->
           </mbean>
          
           <mbean code="org.jboss.invocation.jrmp.server.JRMPInvokerHA"
           name="jboss:service=invoker,type=jrmpha">
           <attribute name="ServerAddress">${jboss.bind.address}</attribute>
           <!--
           <attribute name="RMIObjectPort">0</attribute>
           <attribute name="RMIClientSocketFactory">custom</attribute>
           <attribute name="RMIServerSocketFactory">custom</attribute>
           -->
           </mbean>
          
           <!-- ==================================================================== -->
           <!-- Distributed cache invalidation -->
           <!-- ==================================================================== -->
          
           <mbean code="org.jboss.cache.invalidation.bridges.JGCacheInvalidationBridge"
           name="jboss.cache:service=InvalidationBridge,type=JavaGroups">
           <depends>jboss:service=DefaultPartition</depends>
           <depends>jboss.cache:service=InvalidationManager</depends>
           <attribute name="InvalidationManager">jboss.cache:service=InvalidationManager</attribute>
           <attribute name="PartitionName">DefaultPartition</attribute>
           <attribute name="BridgeName">DefaultJGBridge</attribute>
           </mbean>
          
          </server>
          


          • 2. Re: Help required setting up TCP based cluster
            mondrejko Newbie

            Thanks for the quick reply. Unfortunately, even using a real IP address gives me the same result. The two nodes still fail to recognize one another.

            • 3. Re: Help required setting up TCP based cluster
              mondrejko Newbie

              It appears that the problem that I faced was caused because different JDKs were in use on the two machines. One was using 1.4.2_03, the other was using 1.4.2_04. Once 1.4.2_04 was used on both machines, all was well with startup of the cluster- the two nodes recognized one another and provided the proper cluster view.

              • 4. Re: Help required setting up TCP based cluster
                Cesar Ruiz Newbie

                Check, bind_adress not is 127.0.0.1

                SALUDOS
                CAESAR

                • 5. Re: Help required setting up TCP based cluster
                  Afshan Zabihi Newbie

                  Hi All,
                  I have the same problem, I have checked the java version both are the same. If I use UDP every thing is allright but if I change it to TCP two nodes cannot find eachother.

                  any help!!

                  Thanks

                  • 6. Re: Help required setting up TCP based cluster
                    Ashit Kumar Newbie

                    PLease look at the Trouble shooting section of the Cluster configuration manual. It seems that you have the medai sense issue stumbled upon by accident