首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何使用terracotta服务器实现集群缓存?

如何使用terracotta服务器实现集群缓存?
EN

Stack Overflow用户
提问于 2020-05-26 10:47:06
回答 1查看 216关注 0票数 0

谁能告诉我如何使用terracota服务器在两个微服务之间实现集群缓存共享任何参考项目都可以开始

eh-cache.xml

代码语言:javascript
复制
ehcache xml : <?xml version="1.0" encoding="UTF-8"?>

<ehcache:config`enter code here`
  xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
  xmlns:terracotta='http://www.ehcache.org/v3/clustered'
  xmlns:ehcache='http://www.ehcache.org/v3'
  xsi:schemaLocation="http://www.ehcache.org/v3 http://www.ehcache.org/schema/ehcache-core-3.8.xsd
    http://www.ehcache.org/v3/clustered http://www.ehcache.org/schema/ehcache-clustered-ext-3.8.xsd">

  <ehcache:service>
    <terracotta:cluster>
      <terracotta:connection url="terracotta://localhost:9410/clustered"/>
      <terracotta:server-side-config auto-create="true">
          <!--<terracotta:default-resource from="default-resource"/>-->
          <terracotta:shared-pool name="shared-pool-expense" unit="MB">100</terracotta:shared-pool>
      </terracotta:server-side-config>
    </terracotta:cluster>
 </ehcache:service>


  <ehcache:cache alias="areaOfCircleCache">
    <ehcache:key-type>java.lang.String</ehcache:key-type>
    <ehcache:value-type>com.db.entity.LogMessage</ehcache:value-type>
    <ehcache:resources>
      <!--      <ehcache:heap unit="entries">100</ehcache:heap>
       <ehcache:offheap unit="MB">10</ehcache:offheap>-->
      <terracotta:clustered-dedicated unit="MB">10</terracotta:clustered-dedicated>
    </ehcache:resources>
  </ehcache:cache>
</ehcache:config>
EN

回答 1

Stack Overflow用户

发布于 2020-05-28 20:11:22

这个问题是相当大的。我建议从the documentation开始,如果有你不能弄明白的事情,就问一些具体的问题。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/62013835

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档