Terracotta与EHcache集群

Terracotta与EHcache集群

发布日期:11-04-26 01:24    文章来源:互联网
的另一种为集群多种类型的数据如:Cache、POJO、Session等(官方称定制安装)。1.环境需求
●JDK1.5 或者更高
●Terracotta3.2 或者更高
●所有被集群的对象是可串行化(serializable)2.配置ehcache.xml
●将${TERRACOTTA_HOME}/distributed-cache/ehcache.xsd、
${TERRACOTTA_HOME}/distributed-cache/ehcache.xml复制到项目中的如:src下●将ehcache.xml配置文件的ehcache元素修改成:
<ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="ehcache.xsd"
name="SSO4Cache" updateCheck="false" monitoring="autodetect"><defaultCache
maxElementsInMemory="10000"
eternal="false"
timeToIdleSeconds="120"
timeToLiveSeconds="120"
overflowToDisk="true"
diskSpoolBufferSizeMB="30"
maxElementsOnDisk="10000000"
diskPersistent="false"
diskExpiryThreadIntervalSeconds="120"
memoryStoreEvictionPolicy="LRU"
/><cache name="cn.com.commnet.cas.OBJECT_ECACHE"
maxElementsInMemory="1000"
eternal="false"
timeToIdleSeconds="300000"
timeToLiveSeconds="600000"
memoryStoreEvictionPolicy="LFU"
>
<terracotta clustered="true" valueMode="identity"/>
<!--表示该cache要加入到terracotta service中-->
</cache><cache name="cn.com.commnet.policyagent.GLOBAL_ECACHE"
maxElementsInMemory="1000"
eternal="false"
timeToIdleSeconds="300000"
timeToLiveSeconds="600000"
memoryStoreEvictionPolicy="LFU"
>
<terracotta clustered="true"/> <!--表示该cache要加入到terracotta service中-->
</cache>★valueMode 模式分两种1.serialization模式(默认)2.identity 模式(该模式只能在EHcache自定义安装下有效,快速安装下该模式无效)
1.serialization模式:在该模式下TC(terracotta Client)从TS(terracotta Service)缓存中获取一个元素得到了该元素的副本。所做的更改不影响元素在TS缓存或者其他TC元素副本。只有将在TS缓存中的元素覆盖其他TC也将更新。
2.identity 模式:TC从TS缓存中获取一个元素的引用。TC所做的更改将及时更新了每个TC节点上的元素引用。
★去除无效的 <terracottaConfig url="locahost:9510"/>、 <cacheManagerEventListenerFactory class="" properties=""/>、<diskStore path="java.io.tmpdir"/>3.修改tc-config.xml文件
<modules>
<module name="tim-ehcache-1.7"/> <!--增加-->
<module name="tim-tomcat-6.0"/>
<module name="tim-quartz-1.7"/>
</modules>
并复制到没一个TS、TC上,后面操作与《》一致
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值