Java 我们是否需要在 ehcache 上使用 terracotta 进行聚类?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/9664403/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-16 05:49:46  来源:igfitidea点击:

Do we need terracotta on top of ehcache for clustering?

javaehcacheterracotta

提问by Venkat Teki

I am doing to a proof of concept using ehcache as the cache provider.

我正在使用 ehcache 作为缓存提供程序进行概念验证。

Read somewhere saying we need terracotta server running, ALONG WITH ehcache to provide clustering.

读到某处说我们需要运行 terracotta 服务器,连同 ehcache 以提供集群。

Does ehcache alone provide clustering service or we need terracotta also?

ehcache 是单独提供集群服务还是我们还需要 terracotta?

Thanks, Venkat

谢谢,文卡特

采纳答案by Alex Snaps

If you don't require clustering, but replication would suffice, ehcache comes with RMI replication bundled and has jgroups as well as JMS replication available:

如果你不需要集群,但复制就足够了,ehcache 附带了 RMI 复制捆绑,并且有 jgroups 和 JMS 复制可用:

see http://www.ehcache.org/documentation/2.7/get-started/cache-topologies.html#replicated-caching

http://www.ehcache.org/documentation/2.7/get-started/cache-topologies.html#replicated-caching

回答by moodywoody

If you want the cache (or the caches) to be available from different JVMs you will need Terracotta; ehCache alone cannot do that.

如果您希望缓存(或多个缓存)可从不同的 JVM 中使用,您将需要 Terracotta;ehCache 本身无法做到这一点。

http://www.ehcache.org/documentation/2.7/get-started/about-distributed-cache.html

http://www.ehcache.org/documentation/2.7/get-started/about-distributed-cache.html

Of course you could also look at other solutions like Hazelcast.

当然,您也可以查看其他解决方案,例如 Hazelcast。

http://www.hazelcast.com/

http://www.hazelcast.com/

回答by Alexis Dufrenoy

EhCache is not a distributed solution. So you need to use it with Terracotta to obtain the result you want. Like moodywoody said, you can use Hazelcast, but also Infinispan to obtain this result:

EhCache 不是分布式解决方案。因此,您需要将它与 Terracotta 一起使用才能获得您想要的结果。就像穆迪伍德说的,你可以使用 Hazelcast,也可以使用 Infinispan 来获得这个结果:

http://www.jboss.org/infinispan

http://www.jboss.org/infinispan