linux 部署分布式ehcache,两个实例无法同步数据的一个坑
windows系统测试过分布式ehcache,两个实例ehcache数据彼此之间可以同步,到了linux环境无法同步:
- linux实例1:192.168.0.228
- linux实例2:192.168.0.77
- jdk版本: JDK1.6
- web容器: jboss-4.2.3.GA
- ehcache版本: ehcache-2.10.5-distribution
linux实例1配置
<cacheManagerPeerProviderFactory
class="net.sf.ehcache.distribution.RMICacheManagerPeerProviderFactory"
properties="peerDiscovery=manual,rmiUrls=//192.168.0.77:40000/cdmsObjectCache"
propertySeparator=","
/>
<cacheManagerPeerListenerFactory
class="net.sf.ehcache.distribution.RMICacheManagerPeerListenerFactory"
properties="hostName=192.168.0.228,port=40000,socketTimeoutMillis=120000"
propertySeparator="," />
<!-- cacheEventListenerFactory - 监听缓存中element的put, remove, update和expire事件 -->
<!-- bootstrapCacheLoaderFactory - 启动时加载缓存的element每个用来做分布式缓存都必须设定element的事件监听器,用来在各个CacheManager节点复制消息。 -->
<!-- eternal:boolean类型,表示是否永恒,默认为false。 如果设为true,将忽略timeToIdleSeconds和timeToLiveSeconds,Cache内的元素永远都不会过期,也就不会因为元素的过期而被清除了。 -->
<cache