【问题标题】:how to manage spring cache in cluster environment集群环境下如何管理spring cache
【发布时间】:2016-12-25 23:23:38
【问题描述】:

我正在尝试使用 spring 为我的应用程序构建缓存服务。缓存需要从数据库中填充。

我的应用程序在三个节点上运行,并希望所有三个节点都与缓存同步。如果一个节点在缓存中获得更新的值,它应该通知其他节点。

我看了Spring Cache abstration,它没有谈到集群环境中的缓存。

有没有办法将缓存通知传播到其他节点?

【问题讨论】:

  • Spring Cache 只是一个抽象。对于您正在使用的实际实现,集群将是一个问题。例如,如果您使用 Redis,则应配置 Spring 以连接到您的 Redis 集群。
  • 我使用 EHcache 已经有一段时间了,它很容易配置。已经有一篇关于它的 stackoverflow 帖子:stackoverflow.com/questions/36934115/…

标签: java spring caching spring-cache


【解决方案1】:

看看使用 Spring memcached 插件进行分布式缓存。

https://github.com/jacobhe/spring-boot-tomcat-memcached

【讨论】:

    猜你喜欢
    • 2012-04-09
    • 1970-01-01
    • 2014-09-30
    • 2014-12-17
    • 2017-04-20
    • 1970-01-01
    • 1970-01-01
    • 2011-06-04
    • 1970-01-01
    相关资源
    最近更新 更多