1

我可以通过 jconsole 连接 glassfish 3.1 JMX 接口。我想知道如何检查指定集群中每个实例的正常运行时间。我可以通过 JMX 使用以下对象名和操作对了解它们的状态和 ip

amx:pp=/domain/servers,type=server,name=instanceMaster->isRunning() amx:pp=/domain/servers,type=server,name=instanceMaster->getAdminHost()

每个实例的正常运行时间值可以通过 restfull 接口捕获。 http://47.168.96.31:4848/management/domain/clusters/cluster/cluster1/list-instances

提前感谢ins

4

2 回答 2

1

mmc18 无法使用 JMX 连接到集群节点的原因是因为 3.1.2 中存在一个错误,阻止通过 JMX 远程访问实例。http://java.net/jira/browse/GLASSFISH-18450此错误已修复,但仅在 glassfish 4 中,但是,有人将修复移植到 3.1.2

于 2012-05-16T13:41:32.413 回答
0

You can determine the uptime of a JVM by interrogating the RuntimeMXBean. It exposes an attribute called Uptime which is the number of milliseconds since the JVM started. The ObjectName of the RuntimeMXBean is the constant java.lang.management.ManagementFactory.RUNTIME_MXBEAN_NAME.

于 2012-05-10T12:04:58.657 回答