您的位置:首页 > 其它

ehcache集群详解二(集群的最小配置)

2015-08-16 18:38 260 查看
下面是实现一个Ehcache集群的最小配置:

<cacheManagerPeerProviderFactory class="net.sf.ehcache.distribution.RMICacheManagerPeerProviderFactory"
properties="peerDiscovery=automatic,
multicastGroupAddress=230.0.0.1,
multicastGroupPort=4446"/>
<cacheManagerPeerListenerFactory class="net.sf.ehcache.distribution.RMICacheManagerPeerListenerFactory"/>


在缓存里添加下面的配置:

<cacheEventListenerFactory  class="net.sf.ehcache.distribution.RMICacheReplicatorFactory"/>


就像下面这个配置:

<cache name="sampleDistributedCache1"
maxEntriesLocalHeap="10"
eternal="false"
timeToIdleSeconds="100"
timeToLiveSeconds="100">
<cacheEventListenerFactory  class="net.sf.ehcache.distribution.RMICacheReplicatorFactory"/>
</cache>


集群里的每个缓存节点都要有上面的配置。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息