terracota ehcache配置详解
来源:互联网 发布:android系统优化 编辑:程序博客网 时间:2024/06/05 04:39
一、服务器端配置
1、安装terracotta
java -jar terracotta-3.2.1-installer.jar
2、配置terracotta server的配置文件 tc-config.xml ,可以在 服务器terracotta 根目录的 terracotta/platform/samples 下面找到,修改该文件成如下,把house部分的IP地址改成服务真正的IP地址
<?xml version="1.0" encoding="UTF-8"?>
<!--
All content copyright Terracotta, Inc., unless otherwise indicated. All rights reserved.
-->
<tc:tc-config xmlns:tc="http://www.terracotta.org/config"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.terracotta.org/schema/terracotta-5.xsd">
<!-- Tell DSO where the Terracotta server can be found;
See
- Terracotta Configuration Guide and Reference
- About Terracotta Configuration Files
for additional information. -->
<servers>
<server host="10.187.216.28" name="server1">
<dso-port>9510</dso-port>
<jmx-port>9520</jmx-port>
<data>terracotta/demo-server/server-data</data>
<logs>terracotta/demo-server/server-logs</logs>
<statistics>terracotta/demo-server/server-statistics</statistics>
</server>
</servers>
</tc:tc-config>
第三步:启动terracotta server
nohup ./bin/start-tc-server.sh tc-config.xml &
注意事项:如果启动的时候不添加 tc-config.xml 参数,terracotta 服务器会默认使用 127.0.0.1 作为ip,所以如果不是本级,一定要配置第二步的IP地址
二、客户端配置:
只需要修改ehcache.xml 文件,添加
<terracottaConfig url="10.187.216.28:9510"/>
<terracotta clustered="true"/>
客户端配置文件如下:
<?xml version="1.0" encoding="UTF-8"?>
<ehcache name="myCache" updateCheck="false">
<diskStore path="java.io.tmpdir"/>
<!--
<terracottaConfig url="10.187.216.28:9510"/>
-->
<terracottaConfig url="10.187.216.28:9510"/>
<!-- xul(2009-12-23) -->
<defaultCache
maxElementsInMemory="10000"
eternal="false"
timeToIdleSeconds="1800"
timeToLiveSeconds="1800"
overflowToDisk="false"
diskSpoolBufferSizeMB="30"
maxElementsOnDisk="10000000"
diskPersistent="false"
diskExpiryThreadIntervalSeconds="120"
memoryStoreEvictionPolicy="LRU"
>
</defaultCache>
<cache name="syscache"
maxElementsInMemory="100000"
eternal="false"
timeToIdleSeconds="0"
timeToLiveSeconds="0"
overflowToDisk="false"
memoryStoreEvictionPolicy="LFU"
>
<terracotta clustered="true"/>
</cache>
<!-- 6 hour-->
<cache name="shopCache"
maxElementsInMemory="100000"
eternal="false"
timeToIdleSeconds="0"
timeToLiveSeconds="21600"
overflowToDisk="false"
memoryStoreEvictionPolicy="LFU"
>
<terracotta clustered="true"/>
</cache>
</ehcache>
原文地址:http://www.itmmd.com/201410/74.html
该文章由 android开发 整理发布,转载须标明出处。。
- terracota ehcache配置详解
- ehcache 配置详解
- ehcache 配置详解 教程
- Java Ehcache 配置详解
- EHCACHE配置详解
- EHCACHE配置详解
- ehcache.xml配置详解
- ehcache 配置详解
- EhCache配置详解
- Ehcache配置详解
- ehcache.xml配置详解
- Ehcache配置参数详解
- ehcache配置参数详解
- Ehcache 中ehcache.xml 配置详解
- hibernate二级缓存 Ehcache配置详解
- hibernate二级缓存 Ehcache配置详解
- springmvc+mybatis+ehcache配置详解
- ehcache.xml文件配置详解
- 栈&堆 数据结构 内存
- 注册时手机获取验证码倒计时,使用CountDownTimer类轻松实现倒计时功能
- win7(64位)彻底卸载mysql,重装不再烦恼
- Java集合框架总结(2)——Set接口的使用
- 【vim小记】vim的高效移动
- terracota ehcache配置详解
- 字符串与多维数组实验
- ROS 应用 1 2014年12月29日
- 《数据结构》实验二:线性表的实验(顺序表)
- [系统级] 汇编实现旋转锁
- 解析xml乱码
- LoadStdProfileSettings -- 加载MRU
- android 各类demo链接
- maven+springMVC+mybatis+junit详细搭建过程