spring-boot - ehcache 和 spring-boot 中的复制缓存
问题描述
ehcache 版本 2.8.3 正在 spring-boot 中使用。待测试的服务器是基于linux的服务器A和服务器B缓存共有三种下面是ehcache.xml的配置。
<ehcache>
<diskStore path="java.io.tmpdir" />
<cacheManagerPeerProviderFactory class="net.sf.ehcache.distribution.RMICacheManagerPeerProviderFactory"
properties="peerDiscovery=automatic, multicastGroupAddress=230.0.0.1, multicastGroupPort=40001,
timeToLive=1 ,replicatePuts=true,replicatePutsViaCopy=true ,replicateUpdates=true ,replicateUpdatesViaCopy=false,
replicateRemovals=true ,replicateAsynchronously=false"/>
<cacheManagerPeerListenerFactory class="net.sf.ehcache.distribution.RMICacheManagerPeerListenerFactory"
properties="socketTimeoutMillis=2000, port=40001"/>
<cache name="aCache"
maxElementsInMemory="0"
eternal="true"
timeToIdleSeconds="0"
timeToLiveSeconds="0"
overflowToDisk="false">
<cacheEventListenerFactory class="net.sf.ehcache.distribution.RMICacheReplicatorFactory"/>
<bootstrapCacheLoaderFactory
class="net.sf.ehcache.distribution.RMIBootstrapCacheLoaderFactory"
properties="bootstrapAsynchronously=true"
propertySeparator="," />
<!-- <cacheEventListenerFactory class="net.sf.ehcache.distribution.RMICacheReplicatorFactory"
properties="replicateAsynchronously=true, replicatePuts=true, replicateUpdates=true,
replicateUpdatesViaCopy=false, replicateRemovals=true"/> -->
</cache>
<cache name="bCache"
maxElementsInMemory="0"
eternal="true"
timeToIdleSeconds="0"
timeToLiveSeconds="0"
overflowToDisk="false">
<cacheEventListenerFactory class="net.sf.ehcache.distribution.RMICacheReplicatorFactory"/>
<bootstrapCacheLoaderFactory
class="net.sf.ehcache.distribution.RMIBootstrapCacheLoaderFactory"
properties="bootstrapAsynchronously=true"
propertySeparator="," />
</cache>
<cache name="cCache"
maxElementsInMemory="0"
eternal="true"
timeToIdleSeconds="0"
timeToLiveSeconds="0"
overflowToDisk="false">
<cacheEventListenerFactory class="net.sf.ehcache.distribution.RMICacheReplicatorFactory"/>
<bootstrapCacheLoaderFactory
class="net.sf.ehcache.distribution.RMIBootstrapCacheLoaderFactory"
properties="bootstrapAsynchronously=true"
propertySeparator="," />
</cache>
</ehcache>
服务器 A 和服务器 B 上的 Ehcache.xml 使用相同的设置输入。当我在服务器 A 上添加缓存时,我想查看在服务器 B 上添加的缓存
只会显示以下日志,但服务器 B 无法检查添加的缓存。
[组播心跳接收线程] DEBUG nsedMulticastKeepaliveHeartbeatReceiver - rmiUrls 收到 //192.168.10.20:40001/aCache|//192.168.10.20:40001/bCache|//192.168.10.20:40001/cCache
如果你知道怎么做,请告诉我。
解决方案
推荐阅读
- botframework - 如何使用 BotFramework Composer 运行主动对话
- react-hook-form - react-hook-form FormContext 默认值问题
- android - 如何从当前导航路线中获取剩余路线/坐标
- jupyter - 如何在 Jupyter Lab 暗模式下使工具栏选择颜色可见?
- tensorflow - 获取特定层的输出作为测试数据的结果,而不是 keras 中的最后一层(自动编码器潜在特征)
- image - 从子文件夹中提取 .jpeg 文件并使用 SSIS 将它们放在另一个文件夹中
- react-native - 我们什么时候应该在 React Native 中使用 `accessibilityRole`?
- angular - rxJs 三个 observables,前两个响应作为第三个的参数
- r - 如何使用 ggplot2 更改堆叠条形图的顺序和配色方案?
- c# - 在 ApplicationUser 中保持用户锁定状态的最佳方法是什么?