ehcache集群配置terracotta

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重启之后,应用必须重启,否则整个应用都用不了了。目前只能学习使用。

你可能感兴趣的:(java,C++,c,xml,.net)