Very slow replication in cluster
anweibel Feb 22, 2013 9:41 AMAnother beginner's question...
We have set up an infinispan replication cluster with two members, both running on the same machine. When we change the content of a node on one host, the other member of the cluster seems to pick up this change only after severeal minutes - which seems like a very long time.
Is there a way to force infinspan to replicate changes immediately? Or have I misconfigured something? Or is the delay not caused in infinispan, but there is another layer of caching in modeshape?
Thank you for any hints!
-------------------------------------------------------
This is how we save changes to nodes
public static void nodeSave( String identifier ) throws Exception {
com.arjuna.ats.jta.UserTransaction.userTransaction().begin();
Node node = getJcrSession().getNodeByIdentifier(identifier);
node.setProperty("title", params.get("title") != null ? params.get("title") : "");
node.setProperty("src", params.get("src") != null ? params.get("src") : "");
getJcrSession().save();
com.arjuna.ats.jta.UserTransaction.userTransaction().commit();
}
Infinispan configuration
<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"> <global> <transport clusterName="infinispan-cluster"> <properties> <property name="configurationFile" value="jgroups-tcp.xml" /> </properties> </transport> </global> <namedCache name="clusteredCache"> <loaders passivation="false" shared="false" preload="false"> <loader class="org.infinispan.loaders.file.FileCacheStore" fetchPersistentState="false" purgeOnStartup="false"> <properties> <property name="location" value="infinispanCacheDir" /> </properties> </loader> </loaders> <transaction transactionMode="TRANSACTIONAL" lockingMode="OPTIMISTIC" transactionManagerLookupClass="org.infinispan.transaction.lookup.JBossStandaloneJTAManagerLookup" /> <clustering mode="replication"> <stateTransfer chunkSize="0" fetchInMemoryState="true" timeout="240000" /> <sync replTimeout="20000" /> </clustering> </namedCache> </infinispan>
Repository configuration
{
"name" : "myRepository",
"workspaces" : {
"predefined" : ["otherWorkspace"],
"default" : "default",
"allowCreation" : true,
"initialContent" : {
"default" : "xmlImport/init.xml"
}
},
"storage" : {
"cacheConfiguration" : "infinispan.xml",
"cacheName" : "clusteredCache",
"binaryStorage" : {
"minimumBinarySizeInBytes" : 4096,
"minimumStringSize" : 4096,
"type" : "file",
"directory" : "infinispanBinaryStorage"
}
},
"node-types" : ["types.cnd"],
"security" : {
"anonymous" : {
"roles" : ["readonly","readwrite","admin"],
"useOnFailedLogin" : false
}
}
}
Output at startup time
13:39:29,672 INFO ~ ModeShape version 3.1.2.Final 13:39:29,759 INFO ~ Configured the freemarker templating system 13:39:29,763 INFO ~ Application 'myApp' is now started ! 13:39:31,286 INFO ~ ISPN000078: Starting JGroups Channel 13:39:31,737 INFO ~ ISPN000094: Received new cluster view: [client-43181|1] [client-43181, client11-24967] 13:39:31,739 INFO ~ ISPN000079: Cache local address is client-24967, physical addresses are [127.0.0.1:7801] 13:39:31,746 INFO ~ ISPN000128: Infinispan version: Infinispan 'Brahma' 5.1.2.FINAL 13:39:31,747 WARN ~ ISPN000149: Fetch persistent state and purge on startup are both disabled, cache may contain stale entries on startup 13:39:31,822 INFO ~ ISPN000107: Retrieving transaction manager Transaction: unknown 13:39:32,756 INFO ~ ARJUNA012163: Starting service com.arjuna.ats.arjuna.recovery.ActionStatusService on port 52027 13:39:32,760 INFO ~ ARJUNA012337: TransactionStatusManagerItem host: 127.0.0.1 port: 52027 13:39:32,764 INFO ~ ARJUNA012170: TransactionStatusManager started on port 52027 and host 127.0.0.1 with service com.arjuna.ats.arjuna.recovery.ActionStatusService