双11狂欢大促

盲盒赢 定制羽绒服

开启惊喜盲盒,抽取你的专属好礼

— 惊喜奖品抢先看 —

ehcache rmi缓存同步求教

学无止境-逆流而上 学无止境-逆流而上 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
有A、B 2台机,缓存用ehcache,rmi方式,发现缓存不同步。
比如:在A机修改了某个用户,同时更新缓存。但下次访问时,有时候返回更新前结果,有时返回更新后结果,其实就是A机修改缓存后,并没有更新到B机子。
据说是因为ehcache rmi方式的缓存同步不太靠谱,但也不至于这个明显吧。
<cacheManagerPeerProviderFactory class="net.sf.ehcache.distribution.RMICacheManagerPeerProviderFactory"
properties="peerDiscovery=manual, socketTimeoutMillis=2000, rmiUrls=//ehcache.host.other:40005/activeSessionsCache|//ehcache.host.other:40005/userCache|//ehcache.host.other:40005/sysCache|//ehcache.host.other:40005/actCache" />
<cacheManagerPeerListenerFactory class="net.sf.ehcache.distribution.RMICacheManagerPeerListenerFactory"
properties="hostName=127.0.0.1, port=40005, socketTimeoutMillis=2000"/>
...全文

相关推荐

评论
收藏 已收藏
分享
返回顶部