简体   繁体   English

如何为多个JVM使用单个JMX代理?

[英]How to have a single JMX proxy for multiple JVMs?

When running multiple JVMs on a single machine (single IP address as well), incorporating JMX in each JVM requires a separate port. 在单台机器上运行多个JVM(单个IP地址)时,在每个JVM中集成JMX需要一个单独的端口。 For reasons I won't get into configured ports are at a premium in this environment, so instead I'd like to have a single JMX proxy on each machine that is capable of providing access to each of the local JVMs and their JMX data. 由于我不会在这种环境中进入配置端口的原因,所以我希望在每台机器上都有一个JMX代理,它能够提供对每个本地JVM及其JMX数据的访问。 This would be similar to a local SNMP daemon with agents running in each separate process. 这类似于本地SNMP守护程序,其中代理程序在每个单独的进程中运行。

Ephemeral ports are fine, however, since they're outside the contested range of ports I have access to for configuring JMX explicitly. 然而,短暂的端口很好,因为它们超出了我有权访问的有争议的端口范围,可以显式配置JMX。

I know that products like Oracle Coherence do this internally, but are there any general solutions for doing this? 我知道像Oracle Coherence这样的产品在内部执行此操作,但是有没有通用的解决方案呢?

The OpenDMK supports MBeanServer Cascading which is logically what you want to achieve, which is exposing multiple MBeanServers under the facade of one MBeanServer. OpenDMK支持MBeanServer Cascading ,这在逻辑上是您想要实现的,它在一个MBeanServer的外观下公开多个MBeanServers。 The problem is that there is not "port free" form of inter-JVM JMX remoting, even for JVMs on the same host, so each JVM will still need to bind to at least 1 port, even if it is only accessed on localhost.. (Using JMXMP is your best bet for minimizing port usage since it is a single socket solution rather than RMI which is ..... non-deterministic). 问题是,即使对于同一主机上的JVM,也没有“端口自由”形式的JVM间JMX远程处理,因此每个JVM仍然需要绑定到至少1个端口,即使它只在localhost上访问。 (使用JMXMP是最小化端口使用的最佳选择,因为它是单插槽解决方案而不是RMI,这是非确定性的)。 If you can live with this, then the Cascading actually works quite nicely and the protocol is implemented in the standard contemporary JMX remoting spec. 如果你可以忍受这个,那么Cascading实际上工作得非常好,协议是在标准的现代JMX远程规范中实现的。

The only other way I can think of to allow for many more JVM/JMX Servers than actual ports on a host would be to develop a "TCP-less" JMX Connector Service Provider or multicast. 我认为允许比主机上的实际端口更多JVM / JMX服务器的唯一方法是开发“无TCP”JMX连接器服务提供程序或多播。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM