[英]Grails local ehcache configured in combination with remote Terracotta
[英]Grails 2.1.1 with Terracotta and Ehcache integration
我正在嘗試將Grails 2.1.1與Terracotta和Ehcache集成,但是無論如何我都沒有得到任何好的結果。
有人可以給我一些配置建議嗎? 我有點困惑。
現在正在處理主題。 首先在grails-app/conf
目錄中創建ehcache.xml
。 它看起來應該像這樣:
<ehcache>
<terracottaConfig url="vm4:9510"/>
<defaultCache
maxElementsInMemory="50"
eternal="false"
timeToIdleSeconds="20"
timeToLiveSeconds="20"
overflowToDisk="false"
diskPersistent="false"
memoryStoreEvictionPolicy="LRU"
/>
<cache name="processedUrlCache"
maxElementsInMemory="50000"
eternal="true">
<terracotta />
</cache>
</ehcache>
考慮到terracottaConfig網址應指向Terracotta server
所在的實際host:port。 確保您的tarracotta緩存節點具有<terracotta/>
子節點(類似於我的processUrlCache條目)。
現在,將這三個jar放入您的項目lib目錄中: ehcache-core-ee-2.6.2.jar
, ehcache-terracotta-ee-2.6.2.jar
, terracotta-toolkit-1.6-runtime-ee-5.2.0.jar
實際版本可能有所不同(但是應該與您的terracotta
服務器上的版本完全相同,所以我的建議是從服務器lib目錄中獲取這些jar)。
現在,運行您的服務器( start-tc-server.sh
或start-tc-server.bat
具體取決於Unix / Windows平台)並運行grails應用程序。 首先,我建議您通過在Config.groovy文件中啟用調試日志
debug 'net.sf.ehcache'
進入您的log4j
部分。
讓我知道這對您有幫助。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.