terracotta下载地址:http://www.terracotta.org/dl/oss-download-catalog
傻瓜式安装:java -jar terracotta-3.2.1_2-installer.jar
运行:C:\terracotta\terracotta-3.2.1_2\bin>start-tc-server.bat
pom.xml添加以下配置:
<dependency>
<groupId>net.sf.ehcache</groupId>
<artifactId>ehcache-core</artifactId>
<version>2.1.0</version>
</dependency>
<dependency>
<groupId>net.sf.ehcache</groupId>
<artifactId>ehcache-terracotta</artifactId>
<version>2.1.0</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-jdk14</artifactId>
<version>1.5.11</version>
</dependency>
ehcache.xml配置:
<?xml version="1.0" encoding="UTF-8"?>
<ehcache>
<defaultCache maxElementsInMemory="10000" eternal="false"
timeToIdleSeconds="120" timeToLiveSeconds="120" overflowToDisk="true"
diskSpoolBufferSizeMB="30" maxElementsOnDisk="10000000"
diskPersistent="false" diskExpiryThreadIntervalSeconds="120"
memoryStoreEvictionPolicy="LRU" />
<cache name="securityCache" maxElementsInMemory="3000" maxElementsOnDisk="0"
eternal="false" timeToIdleSeconds="0" timeToLiveSeconds="0"
memoryStoreEvictionPolicy="LFU">
<terracotta />
</cache>
<cache name="userCache" maxElementsInMemory="3000" maxElementsOnDisk="0"
eternal="false" timeToIdleSeconds="0" timeToLiveSeconds="0"
memoryStoreEvictionPolicy="LFU">
<terracotta />
</cache>
<terracottaConfig url="localhost:9510" />
</ehcache>
潜在问题:
terracotta重启之后,应用必须重启,否则整个应用都用不了了。目前只能学习使用。
分享到:
相关推荐
EHCAHCE基于JGROUP的集群配置方案,内含相关配置文件,及配置说明
java ehcache terracotta 集群, 分布式缓存配置
ehcache集群同步配置实例加说明文档
Ehcache集群环境配置
Ehcache集群实例 Ehcache jgroups Ehcache rmi
ehcache3集群相关资源,包括ehcache-clustered-3.10.0-kit、ehcache-3.10.0.jar、ehcache-clustered-3.10.0.jar、terracotta-3.7.7.tar.gz、ehcache-transactions-3.10.0.jar
ehcache的terracotta方案的比较.docx
ehcache集群方案
hibernate ehcache.xml 配置详解
ehcache提供三种网络连接策略来实现集群,rmi,jgroup还有jms。这里只说rmi方式。同时ehcache可以可以实现多播的方式实现集群。也可以手动指定集群主机序列实现集群,本例应用手动指定。
jar包,官方版本,自测可用
jar包,官方版本,自测可用
ehcache-terracotta-2.4.5.jar,ehcache缓存所使用的JAR
ehcache jgroups方式集群,根据网上的资料自己摸索修改的,欢迎下载
ehcache缓存配置详解 个人通过查资料和实践后总结
Ehcache集群配置手册帮助你梳理Ehcache集群部署的配置
Demo of ehCache distributed caching with terracotta in glassFish v3 可以参考:http://blog.csdn.net/guobin0719/archive/2011/04/25/6361940.aspx
此为ehcache的使用以及集群的使用,具体需要两台机子,将ehcache 的hostName替换相应的ip即可
Ehcache缓存配置
当有数据更新的时候,每个进程中的缓存都是独立维护的,如果这些进程缓存同步机制,那么就存在因缓存没有...所以,本文就来说说当使用EhCache的时候,如果来组建进程内缓存EnCache的集群以及配置配置他们的同步策略。