项目中我是把ehcache 作为hibernate的二级缓存使用。
我有两个服务器,并且用apache 集群。
我的ehcache配置。<?xml version="1.0" encoding="UTF-8"?>
<ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="ehcache.xsd">
<cacheManagerPeerProviderFactory
    class="net.sf.ehcache.distribution.RMICacheManagerPeerProviderFactory"
    properties="peerDiscovery=automatic, multicastGroupAddress=230.0.0.1,
    multicastGroupPort=4446, timeToLive=32"
/>
<cacheManagerPeerListenerFactory class="net.sf.ehcache.distribution.RMICacheManagerPeerListenerFactory" /> 

<diskStore path="java.io.tmpdir" />

<defaultCache maxElementsInMemory="10000" eternal="true"
timeToIdleSeconds="10000" timeToLiveSeconds="10000" overflowToDisk="true"
diskSpoolBufferSizeMB="3000" maxElementsOnDisk="10000000"
diskPersistent="false" diskExpiryThreadIntervalSeconds="120"
memoryStoreEvictionPolicy="LRU" /> <cache name="myCache2"
maxElementsInMemory="10000" eternal="false" timeToIdleSeconds="100000" 
timeToLiveSeconds="100000" overflowToDisk="true" >
<cacheEventListenerFactory       
            class="net.sf.ehcache.distribution.RMICacheReplicatorFactory"
properties="replicateAsynchronously=true, replicatePuts=true, 
replicateUpdates=true, replicateUpdatesViaCopy=false, 
replicateRemovals=true"/> 
</cache>
</ehcache>缓存不同步,手动的我也按照官方的配置去搞过,也不同步。
请高手指点或者发个配置好的可以同步的。