3 Replies Latest reply on Nov 25, 2009 8:11 AM by ezza ezaezazea

    JGroups multicast works, JBC cluster doesn't form with same

    ezza ezaezazea Novice

      I'm trying JBC clustering, but so far the cluster never goes past 0 nodes.
      Yes not 1, but 0 nodes!

      cache = org.jboss.cache.pojo.impl.PojoCacheImpl cache=org.jboss.cache.DataContainerImpl [0 nodes, 0 locks] delegate=org.jboss.cache.pojo.impl.PojoCacheDelegate@5bd978 types=0


      I have tried some tests to see where it might come from:

      1/ The JGroups drawing test at http://www.jgroups.org/tutorial/html/ch01.html works perfectly, so at least multicast works.

      2/ The JBoss cache tutorial test with the 2 little clients works

      3/ My two nodes using the default JGroups conf (used by 1/)
      <clustering mode="replication">
       <jgroupsConfig configFile="udp.xml" />
       <sync />
      </clustering>
      


      -->0 nodes on both JVMs

      4/ My two nodes using the sample conf total-replication.xml (used by 2/),
      and supplying the same runtime arguments as 2/
      -Djava.net.preferIPv4Stack=true
      -Dbind.address=127.0.0.1
      


      <jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:jboss:jbosscache-core:config:3.2">
      
       <!--<clustering mode="replication">
       <jgroupsConfig configFile="udp.xml" />
       <sync />
       </clustering>-->
      
       <!-- Configure the TransactionManager -->
       <transaction transactionManagerLookupClass="org.jboss.cache.transaction.GenericTransactionManagerLookup"/>
      
       <clustering mode="replication">
       <!-- JGroups protocol stack properties. -->
       <jgroupsConfig>
       <UDP discard_incompatible_packets="true" enable_bundling="false" enable_diagnostics="false" ip_ttl="2"
       loopback="false" max_bundle_size="64000" max_bundle_timeout="30" mcast_addr="228.10.10.10"
       mcast_port="45588" mcast_recv_buf_size="25000000" mcast_send_buf_size="640000"
       oob_thread_pool.enabled="true" oob_thread_pool.keep_alive_time="10000" oob_thread_pool.max_threads="4"
       oob_thread_pool.min_threads="1" oob_thread_pool.queue_enabled="true" oob_thread_pool.queue_max_size="10"
       oob_thread_pool.rejection_policy="Run" thread_naming_pattern="pl" thread_pool.enabled="true"
       thread_pool.keep_alive_time="30000" thread_pool.max_threads="25" thread_pool.min_threads="1"
       thread_pool.queue_enabled="true" thread_pool.queue_max_size="10" thread_pool.rejection_policy="Run"
       tos="8" ucast_recv_buf_size="20000000" ucast_send_buf_size="640000" use_concurrent_stack="true"
       use_incoming_packet_handler="true"/>
       <PING num_initial_members="3" timeout="2000"/>
       <MERGE2 max_interval="30000" min_interval="10000"/>
       <FD_SOCK/>
       <FD max_tries="5" shun="true" timeout="10000"/>
       <VERIFY_SUSPECT timeout="1500"/>
       <pbcast.NAKACK discard_delivered_msgs="true" gc_lag="0" retransmit_timeout="300,600,1200,2400,4800"
       use_mcast_xmit="false"/>
       <UNICAST timeout="300,600,1200,2400,3600"/>
       <pbcast.STABLE desired_avg_gossip="50000" max_bytes="400000" stability_delay="1000"/>
       <pbcast.GMS join_timeout="5000" print_local_addr="true" shun="false" view_ack_collection_timeout="5000"
       view_bundling="true"/>
       <FRAG2 frag_size="60000"/>
       <pbcast.STREAMING_STATE_TRANSFER/>
       <pbcast.FLUSH timeout="0"/>
      
       </jgroupsConfig>
      
       <sync />
       <!-- Alternatively, to use async replication, comment out the element above and uncomment the element below. -->
       <!-- <async /> -->
      
       </clustering>
      
      </jbosscache>
      


      -->0 nodes on both JVMs

        • 1. Re: JGroups multicast works, JBC cluster doesn't form with s
          ezza ezaezazea Novice

          Here is my test main:

          public class JustStartTheCache
          {
           private final String name;
           private final Cache cache;
          
           public JustStartTheCache(String name)
           {
           this.name = name;
           CacheFactory factory = new DefaultCacheFactory();
           this.cache = factory.createCache ( "resources/META-INF/replSync-service.xml" , false );
           }
          
           public static void main(String[] args)
           {
           new JustStartTheCache( args[0] ).doIt();
           }
          
           private void doIt()
           {
           System.out.println ( name + " STARTING" );
           this.cache.start();
           System.out.println ( name + " STARTED: " + cache );
           }
          }


          My conf:
          <?xml version="1.0" encoding="UTF-8"?>
          
          <jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:jboss:jbosscache-core:config:3.2">
          
           <transaction transactionManagerLookupClass="org.jboss.cache.transaction.GenericTransactionManagerLookup"/>
          
           <!--<clustering mode="replication">
           <jgroupsConfig configFile="udp.xml" />
           <sync />
           </clustering>-->
          
           <clustering mode="replication">
           <jgroupsConfig>
           <UDP discard_incompatible_packets="true" enable_bundling="false" enable_diagnostics="false" ip_ttl="2"
           loopback="false" max_bundle_size="64000" max_bundle_timeout="30" mcast_addr="228.10.10.10"
           mcast_port="45588" mcast_recv_buf_size="25000000" mcast_send_buf_size="640000"
           oob_thread_pool.enabled="true" oob_thread_pool.keep_alive_time="10000" oob_thread_pool.max_threads="4"
           oob_thread_pool.min_threads="1" oob_thread_pool.queue_enabled="true" oob_thread_pool.queue_max_size="10"
           oob_thread_pool.rejection_policy="Run" thread_naming_pattern="pl" thread_pool.enabled="true"
           thread_pool.keep_alive_time="30000" thread_pool.max_threads="25" thread_pool.min_threads="1"
           thread_pool.queue_enabled="true" thread_pool.queue_max_size="10" thread_pool.rejection_policy="Run"
           tos="8" ucast_recv_buf_size="20000000" ucast_send_buf_size="640000" use_concurrent_stack="true"
           use_incoming_packet_handler="true"/>
           <PING num_initial_members="3" timeout="2000"/>
           <MERGE2 max_interval="30000" min_interval="10000"/>
           <FD_SOCK/>
           <FD max_tries="5" shun="true" timeout="10000"/>
           <VERIFY_SUSPECT timeout="1500"/>
           <pbcast.NAKACK discard_delivered_msgs="true" gc_lag="0" retransmit_timeout="300,600,1200,2400,4800"
           use_mcast_xmit="false"/>
           <UNICAST timeout="300,600,1200,2400,3600"/>
           <pbcast.STABLE desired_avg_gossip="50000" max_bytes="400000" stability_delay="1000"/>
           <pbcast.GMS join_timeout="5000" print_local_addr="true" shun="false" view_ack_collection_timeout="5000"
           view_bundling="true"/>
           <FRAG2 frag_size="60000"/>
           <pbcast.STREAMING_STATE_TRANSFER/>
           <pbcast.FLUSH timeout="0"/>
          
           </jgroupsConfig>
           <sync />
           </clustering>
          
          </jbosscache>


          The result is the same no matter which clustering conf i choose:
          NODE1 STARTING
          NODE1 STARTED: org.jboss.cache.DataContainerImpl [0 nodes, 0 locks]


          NODE2 STARTING
          NODE2 STARTED: org.jboss.cache.DataContainerImpl [0 nodes, 0 locks]


          No cluster is formed, and the number of nodes (0) is confirmed in JConsole for the exported MBean for DataContainerImpl.


          • 2. Re: JGroups multicast works, JBC cluster doesn't form with s
            Bela Ban Master

            'Nodes' refers to the number of nodes in the tree, not in the cluster !

            To get the cluster nodes, use the JMX method getMembers() or getView()

            • 3. Re: JGroups multicast works, JBC cluster doesn't form with s
              ezza ezaezazea Novice

              Oops, well it turns out the cluster was indeed forming.