ehcache - springboot中的Ehcache RMI复制不能双向工作
问题描述
我正在使用 ehcache 2.6.8 并在 spring 1.5 上运行。下面是我的 ehcache xml。我有两个节点,代码部署在 linux 框中的 tomcat 服务器中。
下面是我在我的应用程序中使用的 ehcache.xml。
<ehcache name="ehCacheConfig">
<!--disk location where cache will be stored; currently default tmp file path -->
<diskStore path="java.io.tmpdir"/>
<!-- cache manager peer provider -->
<cacheManagerPeerProviderFactory
class="net.sf.ehcache.distribution.RMICacheManagerPeerProviderFactory"
properties="peerDiscovery=automatic, multicastGroupAddress=230.0.0.1, multicastGroupPort=4446, timeToLive=32" />
<!-- cache manager peer Listener -->
<cacheManagerPeerListenerFactory
class="net.sf.ehcache.distribution.RMICacheManagerPeerListenerFactory"
properties="port=40001"/>
<cache
name="EmpCache"
maxBytesLocalHeap="150M"
memoryStoreEvictionPolicy="LFU"
eternal="false"
timeToIdleSeconds="3600"
timeToLiveSeconds="3600"
diskExpiryThreadIntervalSeconds="120"
statistics="true" >
<persistence strategy="localTempSwap"/>
<cacheEventListenerFactory
class="net.sf.ehcache.distribution.RMICacheReplicatorFactory"
properties="replicateAsynchronously=true, replicatePuts=true, replicateUpdates=true,
replicateUpdatesViaCopy=true, replicateRemovals=true "/>
</cache>
</ehcache>
问题:数据正在从节点 1 复制到节点 2。但是当任何请求进入节点 2 并且数据被缓存时,它不会在节点 1 中被复制,如果我遗漏了什么,有人可以告诉我吗?
解决方案
已解决,问题是node1的host文件输入错误,node1的域名映射到127.0.0.1 IP。删除此错误条目后,它起作用了。
推荐阅读
- android-room - Room 数据库实体中的默认值或 NULL
- image - 我想批量提取 gps 数据(exif)然后转换为地址并将该文本保存为 jpg
- android - 如何使 App 设备特定(设备/帐户锁定)?
- ios - 如何快速从我的应用程序中打开另一个应用程序
- datomic - 在 Datomic 查询中使用 System/getProperties 会引发 FileNotFoundException
- sql-server - 从 Dynamics 365 CRM 8.1 升级到 Dynamics 365 CRM 9 后无法删除产品记录
- javascript - React 渲染相同的元素,它是动态组件
- android - Imageview 中的 OpenCV 人脸检测
- java - 使用 sheet 循环遍历工作表对象有什么区别。Iterator() 和 foreach 循环?
- c# - 为什么我需要引用 WPF 应用程序中的所有包。被另一个项目引用