[Logo] Terracotta Discussion Forums (LEGACY READ-ONLY ARCHIVE)
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
[Expert]
Messages posted by: limin  XML
Profile for limin -> Messages posted by limin [11]
Author Message
Ehcache is used in our system. While running unit test cases, I got following info,

2010-1-13 17:34:58 net.sf.ehcache.util.UpdateChecker doCheck
Info: New update(s) found: 1.7.2 [http://ehcache.org/news.html]

Although this prompt info was eventually disabled in ehcache.xml, I still wonder how come Ehcache check user local info (Ehcache version, maybe others we don't know so far) without user permission. From my point of view, Ehcache is Java library, and it doesn't have any rights to check local info (any info) without permission.

Let's hope Ehcache could close any illegal check of user local info!
系统当中使用了Ehcache, 单元测试时突然发现了以下信息:

2010-1-13 17:34:58 net.sf.ehcache.util.UpdateChecker doCheck
信息: New update(s) found: 1.7.2 [http://ehcache.org/news.html]

虽然最后在 ehcache.xml中将这个提示信息关闭了,但对Ehcache (作为一个java类库)竟然会携带用户本地信息(不知道除了版本信息外,还有没有收集其他的未经用户许可的隐私信息) 自动发送Ehcache。本人感到非常震惊!这是我头一回见Java类库敢这么做的,实在是有点担心Ehache是不是还在其中做了其他什么损害用户的检测!

最后,强烈要求Ehcache删除任何未经用户允许的检测!
谢谢老马!
感谢老马,

对于第二个问题, 如果TC Server 细到这个粒度, 想必 TC Server的内存消耗会很大?

例如, EHCache 1用了 2GB缓存
EHCache 2用了 2GB缓存
EHCache 3用了 2GB缓存

那么, TC Server 在两种模式下,分别要耗多少内存呢?


Limin

谢谢老马,

第一种方案并不能最终解决这个问题,因为TC Server有可能一起宕机。
第二个方案有点复杂。这种情况下,用Local EHCache + ActiveMQ (等支持同,异步的消息分发)会更方便,可靠些。

以下是个人的一点建议,如有可能,希望老马能够向Terracotta反馈一下来自用户的建议,

我想EHCache 和 Terracotta 在大多数应用当中,会用于Cache,以提升系统的性能等指标。如果Cache不可用, 系统最坏是取到脏数据,或增加IO负载。Terracotta 没有权力来阻塞整个系统。这种情况下,为什么不让EHCache访问TC server超时,或抛出异常呢?

Limin


发现以下一个问题,

进行以下操作
1) 启动 Terracotta (TC Server 1)

2) 启动 App1 with EHCache, 连接 TC server 1

3) 客户端调用 App1操作 EHCache, 正常

4) 关闭 TC server 1

5) 客户端调用 App1操作 EHCache, 一直等待。。。没有响应。App EHCache的CacheManager似乎用了同步阻塞的方式和TC Server 1通信。

如果EHCache的CacheManager是用了同步阻塞的方式和TC Server 1通信, 请问是否有异步的方式?毕竟 Application不可能因为 TC Server shutdown而没有响应。

有没有遇到相同问题的朋友?


EHCache 采用了 Identity 的 Value Model, 运行时出现以下错误,

Invocation of init method failed; nested exception is net.sf.ehcache.CacheException: One or more caches are configured for identity value mode which is not permitted with standalone deployment
...

TC server,我用了 Custom Installation 的方式安装。

EHCache 引用了
ehcache-terracotta-1.7.1.jar
ehcache-core-1.7.1.jar
slf4j-jdk14-1.5.8.jar
slf4j-api-1.5.8.jar

ehcache.xml 内容如下,

<ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="ehcache.xsd" updateCheck="true" monitoring="autodetect">

<defaultCache
maxElementsInMemory="10000"
eternal="false"
timeToIdleSeconds="120"
timeToLiveSeconds="120"
overflowToDisk="true"
diskSpoolBufferSizeMB="30"
maxElementsOnDisk="10000000"
diskPersistent="false"
diskExpiryThreadIntervalSeconds="120"
memoryStoreEvictionPolicy="LRU"/>

<cache name="testCache"
maxElementsInMemory="10000"
eternal="false"
overflowToDisk="false"
timeToIdleSeconds="300"
timeToLiveSeconds="600"
memoryStoreEvictionPolicy="LFU">
<terracotta clustered="true" valueMode="identity" coherentReads="true" />
</cache>

</ehcache>



TC-config.xml 内容如下,

<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">
<servers>

<server host="localhost" name="tcserver1">
<data>tc/server-data</data>
<logs>tc/server-logs</logs>
</server>

</servers>

<!-- Tell DSO where to put the generated client logs -->
<clients>
<logs>tc/client-logs</logs>
<modules>
<module name="tim-ehcache-1.7"/>
</modules>
</clients>

</tc:tc-config>

有经验的朋友,帮忙看看是什么原因?谢谢

谢谢老马的热心解答。

从你的回复当中,有几个问题再请教一下,

1) 你提到 "...原因是Terracotta有一个服务器在正集群中起到了整体数据协调和调度的功能...", 这里的 一个服务器 是指默认 9510 端口的 TC server吗?

2) "...Terracotta记录一个数据在集群中被哪几个节点使用...", Terracotta 记录的数据使用状况能够到什么粒度, 我想应该是 Cache (例如: <cache name="testCache" />) 这个层面吧?

3) 如果使用 Terracotta 作为Distributed Operation, 那么,如何处理下面这种场景呢?
假设2个 EHCache 节已经处于运行状态,而且它们的数据是一致的。 如果新加入一个EHCache节点, (假设三个节点数据都一样), 那么如何让新加入的EHCache节点启动后,和其他两个节点的数据一致呢?

谢谢
谢谢老马!

Terracotta Clustered Operation 保证了数据的一致性,相对其他三种方式而言,应该会失去一定的性能。当然,这要看系统的应用场景,来选择适合的方式。

不知道,官方有没有在性能方面作过对比?谢谢
Hi Lima,

这些讲座有没有视频回放?

谢谢了
Ehcache 的配置文件当中有两项没太弄明白。

1)
CacheManagerPeerProvider
========================
(For distributed operation)


2)
TerracottaConfig
========================
(Enable for Terracotta clustered operation)


其中提到 'distributed operation' 和 'Terracotta clustered operation', 直观地理解, 两者都是应用到分布式运算。 但不知这两种方式的区别。

请高人指点, 谢谢了

 
Profile for limin -> Messages posted by limin [11]
Go to:   
Powered by JForum 2.1.7 © JForum Team