您的位置:首页 > 产品设计 > UI/UE

Ehcache 1.5.0 User Guide - Remote Network debugging and monitoring for Distributed Caches(远程调式和跟踪分布式缓存)(11)

2009-08-14 10:47 465 查看

11、Remote Network debugging and monitoring for Distributed Caches(远程调式和跟踪分布式缓存)

11.1 Introduction(介绍)

The ehcache-1.x-remote-debugger.jar} can be used to debug replicated cache operations. When started with the same configuration as the cluster, it will join the cluster and then report cluster events for the cache of interest. By providing a window into the cluster it can help to identify the cause of cluster problems.
(ehcache-1.x-remote-debugger.jar包用于调式复制缓存操作。当缓存使用相同的配置以集群的方式启动,会被加入集群并且为感兴趣的缓存报告集群事件。通过提供一个窗口到集群,可以帮助定义集群问题的原因。)

11.2 Packaging(封装)

From version 1.5 it is packaged in its own distribution tarball along with a maven module.
It is provided as an executable jar.
(从1.5版本以后它连同maven模块被封装至本身的分布式tarball包中。)

11.3 Limitations(局限性)

This version of the debugger has been tested only with the default RMI based replication.
(这个调式版本已经仅使用默认的RMI基本复制被测试。)

11.4 Usage(用法)

It is invoked as follows:(使用如下的方法调用:)

java -classpath [add your application jars here]
-jar ehcache-debugger-1.5.0.jar ehcache.xml sampleCache1 path_to_ehcache.xml [cacheToMonitor]

Note: Add to the classpath any libraries your project uses in addition to these above, otherwise RMI will attempt to load them remotely which requires specific security policy settings that surprise most people.
(注意:除了添加以上的库,添加你项目中使用任何库到类路径,否则RMI会尝试远程加载这些库,该加载需要制定安全策略可能使很多人很奇怪。)

It takes one or two arguments:(它使用一个或者两个参数:)
the first argument, which is mandatory, is the ehcache configuration file e.g. app/config/ehcache.xml.
(第一个参数是强制的,是缓存的配置文件,例如app/config/ehcache.xml)

This file should be configured to allow ehcache to joing the cluster. Using one of the existing
ehcache.xml files from the other nodes normally is sufficient.
(这个文件被配置成允许ehcache加入集群。使用现有的来自其他节点的多个ehcache.xml文件中的一个通常是可以满足的。)

the second argument, which is optional, is the name of the cache e.g. distributedCache1
If only the first argument is passed, it will print our a list of caches with replication configured
from the configuration file, which are then available for monitoring.
(第二个参数是可选的,代表缓存的名字。例如distributedCache1,仅有在第一个参数陪传递,才会使用复制配置打印出缓存列表)

If the second argument is also provided, the debugger will monitor cache operations received for the given cache.
This is done by registering a CacheEventListener which prints out each operation.
(如果第二个参数也被提供,调式器才会为给出的缓存监视接收的缓存操作。
通过注册一个CacheEventListener接口用于打印每一个操作。)

11.4.1 Output(输出)

When monitoring a cache it prints a list of caches with replication configured, prints notifications as they happen, and periodically prints the cache name, size and total events received. See sample output below which is produced when the RemoteDebuggerTest is run.
(当监视一个缓存会使用缓存复制的配置信息打印出缓存列表,缓存事件发生时打印通知并且周期性的打印缓存名,大小和总的接收事件。查看下面的运行RemoteDebuggerTest会产生例子输出。)
Caches with replication configured which are available for monitoring are:
sampleCache19 sampleCache20 sampleCache26 sampleCache42 sampleCache33
sampleCache51 sampleCache40 sampleCache32 sampleCache18 sampleCache25
sampleCache9 sampleCache15 sampleCache56 sampleCache31 sampleCache7
sampleCache12 sampleCache17 sampleCache45 sampleCache41 sampleCache30
sampleCache13 sampleCache46 sampleCache4 sampleCache36 sampleCache29
sampleCache50 sampleCache37 sampleCache49 sampleCache48 sampleCache38
sampleCache6 sampleCache2 sampleCache55 sampleCache16 sampleCache27
sampleCache11 sampleCache3 sampleCache54 sampleCache28 sampleCache10
sampleCache8 sampleCache47 sampleCache5 sampleCache53 sampleCache39
sampleCache23 sampleCache34 sampleCache22 sampleCache44 sampleCache52
sampleCache24 sampleCache35 sampleCache21 sampleCache43 sampleCache1
(上面的打印了分布式的缓存列表。)

Monitoring cache: sampleCache1
Cache: sampleCache1 Notifications received: 0 Elements in cache: 0
(打印了缓存名和接收的通知信息和缓存的元素个数。)
Received put notification for element [ key = this is an id, value=this is
a value, version=1, hitCount=0, CreationTime = 1210656023456,
LastAccessTime = 0 ]
(打印了一个添加元素的通知信息。)
Received update notification for element [ key = this is an id, value=this
is a value, version=1210656025351, hitCount=0, CreationTime =
1210656024458, LastAccessTime = 0 ]
(打印了一个更新元素的通知。)
Cache: sampleCache1 Notifications received: 2 Elements in cache: 1
Received remove notification for element this is an id
Received removeAll notification.
(获取移除元素的通知,这是一个ID,
获取移除所有元素的通知。)
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐