0 Replies Latest reply on Dec 21, 2012 8:57 AM by Bahurdeen Mohamed

    Infinispan HotRod Cluster Creation -Pls help me

    Bahurdeen Mohamed Newbie

      Hi,

       

      I need help in Infinispan Cluster creation.I am using Infinispan 5.1.6 HotRod Client\Server, i need to do form cluster.

       

      I have tried the quick start example of infinispan for cluster, I was using following code  but i am not able to form the cluster

      Ia m using following infinispan.xml

       

      updated lines are bold

       

      <infinispan xmlns="urn:infinispan:config:5.1"
                  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                  xsi:schemaLocation="urn:infinispan:config:5.1 http://docs.jboss.org/infinispan/schemas/infinispan-config-5.1.xsd">
         <default>
            <eviction maxEntries="1000" />

         </default>

      <global>

      <transport>
      <properties>
      <property name="configurationFile" value="jgroups-tcp.xml" />
      </properties>
      </transport>
      </global>
      </infinispan>

       

       

      jgroups-tcp.xml:  updated lines are bold


      <config xmlns="urn:org:jgroups"
              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
              xsi:schemaLocation="urn:org:jgroups file:schema/JGroups-3.0.xsd">
         <TCP
              bind_addr="${jgroups.tcp.address:10.242.106.130,jgroups.tcp.address:10.242.106.61}"
              bind_port="${jgroups.tcp.port:7385,jgroups.tcp.port:14458}"
              loopback="true"
              port_range="30"
              recv_buf_size="20m"
              send_buf_size="640k"
              discard_incompatible_packets="true"
              max_bundle_size="64000"
              max_bundle_timeout="30"
              enable_bundling="true"
              use_send_queues="true"
              enable_diagnostics="false"
              bundler_type="old"

              thread_naming_pattern="pl"

              thread_pool.enabled="true"
              thread_pool.min_threads="2"
              thread_pool.max_threads="30"
              thread_pool.keep_alive_time="60000"
              thread_pool.queue_enabled="true"
              thread_pool.queue_max_size="100"
              thread_pool.rejection_policy="Discard"

              oob_thread_pool.enabled="true"
              oob_thread_pool.min_threads="2"
              oob_thread_pool.max_threads="30"
              oob_thread_pool.keep_alive_time="60000"
              oob_thread_pool.queue_enabled="false"
              oob_thread_pool.queue_max_size="100"
              oob_thread_pool.rejection_policy="Discard"       
               />

         <!-- Ergonomics, new in JGroups 2.11, are disabled by default in TCPPING until JGRP-1253 is resolved -->
         <!--
         <TCPPING timeout="3000"
                  initial_hosts="10.242.106.130[7385],10.242.106.61[14458]"
                  port_range="1"
                  num_initial_members="3"
                 
              />
         -->

         <MPING bind_addr="${jgroups.bind_addr:127.0.0.1}" break_on_coord_rsp="true"
            mcast_addr="${jgroups.mping.mcast_addr:228.2.4.6}"
            mcast_port="${jgroups.mping.mcast_port:43366}"
            ip_ttl="${jgroups.udp.ip_ttl:2}"
            num_initial_members="3"/>

         <MERGE2 max_interval="30000" min_interval="10000"/>
         <FD_SOCK/>
         <FD timeout="3000" max_tries="3"/>
         <VERIFY_SUSPECT timeout="1500"/>
         <pbcast.NAKACK
               use_mcast_xmit="false"
               retransmit_timeout="300,600,1200,2400,4800"
               discard_delivered_msgs="false"/>
         <UNICAST2 timeout="300,600,1200"
                   stable_interval="5000"
                   max_bytes="1m"/>
         <pbcast.STABLE stability_delay="500" desired_avg_gossip="5000" max_bytes="1m"/>
         <pbcast.GMS print_local_addr="false" join_timeout="3000" view_bundling="true"/>
         <UFC max_credits="200k" min_threshold="0.20"/>
         <MFC max_credits="200k" min_threshold="0.20"/>
         <FRAG2 frag_size="60000"/>
         <RSVP timeout="60000" resend_interval="500" ack_on_delivery="false" />
      </config>


      Here's the client java code

      Java client 1:

       

      I have put user06 key into jvm1  '10.242.106.130"


      Properties props = new Properties();

         props.put(SERVER_LIST_KEY, "10.242.106.130");
       
         RemoteCacheManager remoteCacheManager  =  new RemoteCacheManager(props);
         RemoteCache<Object, Object> cache = remoteCacheManager.getCache();
               cache.put("user06", "6th user");
              
               System.out.println("****"+cache.getName());
        System.out.println("****"+cache.get("user06"));

       

      Java client 2:

      i try to retrieve  same key ie user06 from diffrent jvm "10.242.106.61" ,but is not working .

           final Properties properties = new Properties();
             properties.put(SERVER_LIST_KEY, "10.242.106.61");
             RemoteCacheManager remoteCacheManager  =  new RemoteCacheManager(properties);
             RemoteCache<Object, Object> remoteCache = remoteCacheManager.getCache();
             System.out.println(remoteCache.get("user06"));
       

      Pls anyone to help me if i missing anything.

       

      Thanks!

      Bahurdeen Ali Ahamed.M