Terracotta与EHcache集群
来源:互联网 发布:gta5 handling漂移数据 编辑:程序博客网 时间:2024/05/17 05:51
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上,后面操作与《》一致
●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上,后面操作与《》一致
- Terracotta与EHcache集群
- Ehcache与terracotta集群配置
- Ehcache与terracotta集群配置
- Ehcache与terracotta集群配置
- Terracotta与Tomcat6集群
- F5+terracotta+EhCache配置分布式集群经验总结
- 分布式缓存之Ehcache与terracotta
- terracotta安装配置与集群过程
- 新闻:Terracotta收购Ehcache
- Ehcache被Terracotta收购
- 集群神器——terracotta与各种框架的整合
- Terracotta集群快速安装
- Terracotta进行tomcat集群
- Terracotta进行tomcat集群
- Java集群平台terracotta
- Terracotta Server集群
- nginx+terracotta+freemarker集群
- terracotta+tomcat集群配置
- Oracle删除当前用户下的所有表、视图、序列、函数、存储过程、包
- poj1422 - Air Raid
- MVC-Controllers 数据验证
- 阿里笔试小结
- Effective C++学习笔记 (14)
- Terracotta与EHcache集群
- 【shell】grep
- poj1383 - Labyrinth
- tree list
- EhCache集群方案-JGroups
- 羌笛声声胡笳怨,此心长寄天涯远
- 深入浅出 MVC 数据验证 2.0 [附演示源码]
- 关于Ehcache集群缓存在应用重启后的加载问题
- AIX