这是我在10.0.110.134机器上的ehcache配置xml:
spread
这是启动两台机器后的错误:
<cache name="sessionIds" maxElementsInMemory="5000" eternal="false"
overflowToDisk="false" timeToIdleSeconds="0" timeToLiveSeconds="0"
memoryStoreEvictionPolicy="LRU">
<bootstrapCacheLoaderFactory
class="net.sf.ehcache.distribution.RMIBootstrapCacheLoaderFactory"/>
</cache>
<!-- Cluster Configuration -->
<cacheManagerPeerProviderFactory
class="net.sf.ehcache.distribution.RMICacheManagerPeerProviderFactory"
properties="peerDiscovery=manual,
rmiUrls=//10.0.110.133:40001/sessionIds"/>
<cacheManagerPeerListenerFactory
class="net.sf.ehcache.distribution.RMICacheManagerPeerListenerFactory"
properties="hostName=10.0.110.134, port=40001,
socketTimeoutMillis=20000"/>
答案 0 :(得分:0)
虽然OP可能为时已晚,但缓存本身需要在RMIReplicatorCacheFactory中注册,例如。
<cache name="sessionIds" maxElementsInMemory="5000" eternal="false"
overflowToDisk="false" timeToIdleSeconds="0" timeToLiveSeconds="0"
memoryStoreEvictionPolicy="LRU">
<cacheEventListenerFactory class="net.sf.ehcache.distribution.RMICacheReplicatorFactory"/>
...
</cache>