1 Reply Latest reply on May 16, 2007 10:11 AM by manik

    POJOCACHE not working properly

    sreejithkt

      Hi,
      I am using pojocache for replication. I have 4 machines for running my clustered application in Tomcat (Tomcat v 5.5.20 on FC-5 OS with JDK 1.5). One of it is running as loadbalancer and Apache 2.2 is used for that. Tomcat clustering is also enabled. My problem is that only two of my systems are getting participated in cache transaction. i.e. the objects that are put into the cache are not replicated over to other servers and hence I am not able to retrieve them at a later point (when the system from which objects are put into cache goes down)
      I have the following conf. for clustering in server.xml of tomcat :

      <Cluster
       className="org.apache.catalina.cluster.tcp.SimpleTcpCluster"
       clusterLogName="clusterlog" doClusterLog="true"
       manager.className="org.apache.catalina.cluster.session.DeltaManager"
       manager.expireSessionsOnShutdown="false"
       manager.notifyListenersOnReplication="false"
       manager.notifySessionListenersOnReplication="false"
       manager.sendAllSessions="false" manager.sendAllSessionsSize="500"
       manager.sendAllSessionsWaitTime="20">
      
       <Membership
       className="org.apache.catalina.cluster.mcast.McastService"
       mcastAddr="228.0.0.4"
       mcastClusterDomain="TreeCache-Cluster" mcastDropTime="30000"
       mcastFrequency="200" mcastPort="45564" />
      
       <Receiver
       className="org.apache.catalina.cluster.tcp.ReplicationListener"
       tcpListenAddress="192.168.0.5" tcpListenPort="9015"
       tcpSelectorTimeout="100" tcpThreadCount="6" />
      
       <Sender ackTimeout="15000"
       className="org.apache.catalina.cluster.tcp.ReplicationTransmitter"
       doProcessingStats="true" doTransmitterProcessingStats="true"
       doWaitAckStats="true" keepAliveMaxRequestCount="-1"
       keepAliveTimeout="80000" queueCheckLock="true" queueDoStats="true"
       queueTimeWait="true" recoverCounter="6" recoverTimeout="500"
       replicationMode="fastasyncqueue" waitForAck="true" />
      
       <Valve
       className="org.apache.catalina.cluster.tcp.ReplicationValve"
       filter=".*\.gif;.*\.js;.*\.css;.*\.png;.*\.jpeg;.*\.jpg;.*\.html;.*\.txt;"
       primaryIndicator="true" />
      
       <Valve
       className="org.apache.catalina.cluster.session.JvmRouteBinderValve"
       enabled="true" />
       <ClusterListener
       className="org.apache.catalina.cluster.session.ClusterSessionListener" />
       <ClusterListener
       className="org.apache.catalina.cluster.session.JvmRouteSessionIDBinderListener" />
      
       <Deployer
       className="org.apache.catalina.cluster.deploy.FarmWarDeployer"
       deployDir="${catalina.base}/war-deploy/"
       tempDir="${catalina.base}/war-temp"
       watchDir="${catalina.base}/war-listen/" watchEnabled="true" />
       </Cluster>
      

      Also my cache config file looks like this :
      <?xml version="1.0" encoding="UTF-8" ?>
      
      <server>
       <mbean code="org.jboss.cache.aop.PojoCache"
       name="jboss.cache:service=PojoCache">
       <depends>jboss:service=TransactionManager</depends>
      
       <!-- Configure the TransactionManager -->
       <attribute name="TransactionManagerLookupClass">
       org.jboss.cache.DummyTransactionManagerLookup
       </attribute>
      
       <!-- Isolation level : SERIALIZABLE
       REPEATABLE_READ (default)
       READ_COMMITTED
       READ_UNCOMMITTED
       NONE
       -->
       <attribute name="IsolationLevel">REPEATABLE_READ</attribute>
      
       <!-- Valid modes are LOCAL, REPL_ASYNC and REPL_SYNC -->
       <attribute name="CacheMode">REPL_SYNC</attribute>
      
       <!-- Just used for async repl: use a replication queue -->
       <attribute name="UseReplQueue">false</attribute>
      
       <!-- Replication interval for replication queue (in ms) -->
       <attribute name="ReplQueueInterval">0</attribute>
      
       <!-- Max number of elements which trigger replication -->
       <attribute name="ReplQueueMaxElements">0</attribute>
      
       <!-- Name of cluster. Needs to be the same for all clusters, in order
       to find each other
       -->
       <attribute name="ClusterName">Sample-Cache</attribute>
      
       <!-- JGroups protocol stack properties. Can also be a URL,
       e.g. file:/home/bela/default.xml
       <attribute name="ClusterProperties"></attribute>
       -->
      
       <!--bind_addr="75.126.68.196" -->
       <attribute name="ClusterConfig">
      
       <config>
       <!-- UDP: if you have a multihomed machine,
       set the bind_addr attribute to the appropriate NIC IP address, e.g bind_addr="192.168.0.2"
       -->
       <!-- UDP: On Windows machines, because of the media sense feature
       being broken with multicast (even after disabling media sense)
       set the loopback attribute to true
       -->
       <UDP mcast_addr="228.1.2.3" mcast_port="48866"
       ip_ttl="64" ip_mcast="true" mcast_send_buf_size="150000"
       mcast_recv_buf_size="80000" ucast_send_buf_size="150000"
       ucast_recv_buf_size="80000" loopback="false" />
       <PING timeout="2000" num_initial_members="3"
       up_thread="false" down_thread="false" />
       <MERGE2 min_interval="10000" max_interval="20000" />
       <FD_SOCK />
       <VERIFY_SUSPECT timeout="1500" up_thread="false"
       down_thread="false" />
       <pbcast.NAKACK gc_lag="50"
       retransmit_timeout="600,1200,2400,4800" max_xmit_size="8192"
       up_thread="false" down_thread="false" />
       <UNICAST timeout="600,1200,2400" window_size="100"
       min_threshold="10" down_thread="false" />
       <pbcast.STABLE desired_avg_gossip="20000"
       up_thread="false" down_thread="false" />
       <FRAG frag_size="8192" down_thread="false"
       up_thread="false" />
       <pbcast.GMS join_timeout="5000"
       join_retry_timeout="2000" shun="true" print_local_addr="true" />
       <pbcast.STATE_TRANSFER up_thread="true"
       down_thread="true" />
       </config>
       </attribute>
      
       <!-- Whether or not to fetch state on joining a cluster -->
       <attribute name="FetchStateOnStartup">true</attribute>
      
       <!-- The max amount of time (in milliseconds) we wait until the
       initial state (ie. the contents of the cache) are retrieved from
       existing members in a clustered environment
      
       -->
       <attribute name="InitialStateRetrievalTimeout">5000</attribute>
      
       <!-- Number of milliseconds to wait until all responses for a
       synchronous call have been received.
       -->
       <attribute name="SyncReplTimeout">15000</attribute>
      
       <!-- Max number of milliseconds to wait for a lock acquisition -->
       <attribute name="LockAcquisitionTimeout">10000</attribute>
      
       <!-- Name of the eviction policy class. -->
       <attribute name="EvictionPolicyClass" />
       </mbean>
      </server>
      

      Any help would be much appreciated !!