当 Terracotta 服务器不可用时,我需要将我的应用程序配置为从 Terracotta 服务器配置切换到 diskStore。有没有办法做到这一点?当我在 ehcache.xml 上配置 terracottaConfig 元素时,如果无法访问 Terracotta 服务器,我将无法启动应用程序......这是我的 ehcache.xml 配置:
<ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="ehcache.xsd" name="gpCacheManager">
<diskStore path="java.io.tmpdir" />
<terracottaConfig rejoin="true">
<tc-config>
<servers>
<server host="XXX.XXX.XXX.XX" name="host1">
</server>
</servers>
<clients>
<logs>app/logs-%i</logs>
</clients>
<nonstop immediateTimeout="true" timeoutMillis="3000">
<timeoutBehavior type="localReads" />
</nonstop>
</tc-config>
</terracottaConfig>
<defaultCache maxElementsInMemory="10000" eternal="false"
timeToIdleSeconds="120" timeToLiveSeconds="120" overflowToDisk="false"
diskPersistent="false" diskExpiryThreadIntervalSeconds="120"
memoryStoreEvictionPolicy="LRU">
<terracotta clustered="true">
<nonstop immediateTimeout="false" timeoutMillis="3000">
<timeoutBehavior type="localReads" />
</nonstop>
</terracotta>
</defaultCache>
<cache name="oxmCache" maxElementsInMemory="10000" eternal="false"
timeToIdleSeconds="240" timeToLiveSeconds="240" overflowToDisk="false"
diskPersistent="false" diskExpiryThreadIntervalSeconds="240"
memoryStoreEvictionPolicy="LRU">
<terracotta clustered="true">
<nonstop immediateTimeout="false" timeoutMillis="3000">
<timeoutBehavior type="localReads" />
</nonstop>
</terracotta>
</cache>
</ehcache>
谢谢!