我的问题是关于使用 ehcache 通过 RMI 进行缓存复制的。假设我有 3 台服务器,它们相互复制缓存。在启动时,我想从其他正在运行的实例( Bootstrap )加载缓存。我关心的是这些主题:
- 我在所有节点上都有内存缓存。我重新启动一个 node1 并在启动时(我同步引导 - bootstrapAsynchronously=false)我从 node2 加载缓存。如果在缓存完全复制之前 node2 突然关闭,会发生什么情况?复制会从 node3 继续吗(它也加载了它)?
- 如果我在异步模式下设置 Bootstrap - 它会抛出一些关于复制已完成且实例已完全加载缓存这一事实的事件吗?
最佳答案
第一部分的答案是缓存不会启动。
When a peer comes up, it will be incoherent with other caches. When the bootstrap completes it will be partially coherent. Bootstrap gets the list of keys from a random peer, and then loads those in batches from random peers. If bootstrap fails then the Cache will not start. However if a cache replication operation occurs which is then overwritten by bootstrap there is a chance that the cache could be inconsistent.
关于java - Ehcache 复制缓存 RMI Bootstrap ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19026125/