[求助] 关于ehcache集群缓存同步数据的问题

10-09-10 xiaohei
我现在有两台server server1(10.9.58.86) server2(remote 10.9.58.68)

server1中的ehcache的配置如下

<ehcache>
	<diskStore path="java.io.tmpdir" /> 
	
	<cacheManagerPeerProviderFactory class="net.sf.ehcache.distribution.RMICacheManagerPeerProviderFactory"
		properties="peerDiscovery=manual,rmiUrls=//10.9.58.68:40000/dictionaryCache" />
		
	<cacheManagerPeerListenerFactory
		class="net.sf.ehcache.distribution.RMICacheManagerPeerListenerFactory"
		properties="hostName=10.9.58.86,port=40000,socketTimeoutMillis=120000" />

	<defaultCache maxElementsInMemory="10000" eternal="false"
		timeToIdleSeconds="120" timeToLiveSeconds="120" overflowToDisk="true"
		diskPersistent="false" diskExpiryThreadIntervalSeconds="120"
		memoryStoreEvictionPolicy="LRU" > 	
	
	</defaultCache> 


	<cache name="dictionaryCache" maxElementsInMemory="100"
		eternal="false" timeToIdleSeconds="3600" timeToLiveSeconds="7200"
		overflowToDisk="true">
		<cacheEventListenerFactory
			class="net.sf.ehcache.distribution.RMICacheReplicatorFactory"
			 properties="replicateAsynchronouly=true,
				         replicatePuts=true,
				         replicateUpdates=true,
				         replicateUpdateViaCopy=true,
				         replicateRemovals=true" />
	</cache>



</ehcache>
<p>

我现在的问题是,在server2上添加一条数据之后要往server1的缓存中同步,

server1的log中也已经提示了

Remote put received. Element is: [ key = com.boco.iam.module.dictionary.dto.IamdictionaryDTO#382, value=Item{version=null,freshTimestamp=5259662664282112, version=1, hitCount=0, CreationTime = 1284097330147, LastAccessTime = 0 ]

但是在server1的缓存中查询不到该数据,我是第一次配置ehcache,还请哪位大哥给解释下这是为什么,有什么样的解决方法,谢谢

猜你喜欢