5 Replies Latest reply: Jul 31, 2012 7:42 AM by Mircea Markus RSS

Cache replication on four nodes

Marino Borra Newbie

Hi all,

 

I have a problem with cache replication on four nodes (A, B, C, D).

 

When put the value in the cache of node A, the value is not sent immediately to nodes B, C, D. If I make a request to node C with the same key, then the cache of node C is aligned with cache on node A (and lose a lot of time).

 

Below the configuration:

 

<?xml version="1.0" encoding="UTF-8"?>
<infinispan
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="urn:infinispan:config:5.1 http://www.infinispan.org/schemas/infinispan-config-5.1.xsd"
      xmlns="urn:infinispan:config:5.1">

    <!-- [staging] -->


    <!-- ..:: GLOBAL ::.. -->
    <global>
        <globalJmxStatistics enabled="true" />

        <evictionScheduledExecutor factory="org.infinispan.executors.DefaultScheduledExecutorFactory">
            <properties><property name="threadNamePrefix" value="EvictionThread" /></properties>
        </evictionScheduledExecutor>

        <transport transportClass="org.infinispan.remoting.transport.jgroups.JGroupsTransport"
            clusterName="infinispan-spring-cluster"
            distributedSyncTimeout="2000"
            strictPeerToPeer="false">
            <properties>
                <property name="configurationFile" value="jgroups-udp.xml" />
            </properties>
        </transport>

        <shutdown hookBehavior="DEFAULT" />
    </global>


    <!-- ..:: DEFAULT ::.. -->
    <default> 

        <jmxStatistics enabled="true" />

        <locking useLockStriping="false"/>

        <eviction strategy="LRU" maxEntries="100" />

        <loaders passivation="true" preload="true" shared="false">
            <loader class="org.infinispan.loaders.file.FileCacheStore"
                    purgeSynchronously="true"
                    purgeOnStartup="false"
                    fetchPersistentState="true"
                    ignoreModifications="false">
                <properties>
                    <property name="location" value="${java.io.tmpdir}/infinispan" />
                </properties>
                <async enabled="true" flushLockTimeout="15000" threadPoolSize="3" />
            </loader>
        </loaders>

        <clustering mode="replication">
            <sync /> 
            <stateTransfer timeout="5000" fetchInMemoryState="true"/>
        </clustering>
    </default>


    <!-- ..:: NAMEDCACHE ::.. -->
    <namedCache name="searchResult">
        <!-- LRU: least-recently-used pattern -->
        <eviction maxEntries="10" strategy="LRU" />

        <expiration maxIdle="300000" wakeUpInterval="300000" lifespan="600000" />

        <jmxStatistics enabled="true"/>

        <loaders passivation="true" preload="true" shared="false">
            <loader class="org.infinispan.loaders.file.FileCacheStore" purgeOnStartup="false" fetchPersistentState="true"
                    ignoreModifications="false">
                <properties>
                    <property name="location" value="${java.io.tmpdir}/infinispan" />
                </properties>
            </loader>
        </loaders>

        <clustering mode="replication">
            <stateTransfer timeout="5000" fetchInMemoryState="true"/>
        </clustering>
    </namedCache>

</infinispan>