且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Java 6是否为JMX远程连接打开了默认端口?

更新时间:2023-12-03 14:11:10

文档表明JMX代理使用本地端口 - 无法访问的东西从机器外部 - 除非您指定以下属性:

The documentation suggests that the JMX agent uses a local port -- something unreachable from outside the machine -- unless you specify the following property:

com.sun.management.jmxremote.port = portNum

这是出于安全原因,以及Potato Head先生给出的理由。因此,看起来Java 6没有为JMX打开默认的远程可访问端口。

This is for security reasons, as well as for the reason given by Mr Potato Head. Thus, it looks like Java 6 does not open a default remotely accessible port for JMX.

编辑:在OP添加答案后添加更多信息。

Added after the OP added an answer with more information.

您拥有的另一个选择是以某种方式创建一个侦听所有本地JMX连接并导出此信息的本地代理。这样,您就不需要在服务器上具有每个JVM实例的这种神奇配置。相反,本地代理可以通过JMX连接到所有JVM,然后以某种方式远程公开此信息。我不确定你将如何实现这一点,但是这样的事情可能比通过JMX远程公开所有JVM所做的工作要少。

Another option you have is to somehow create a local proxy that listens to all local JMX connections and exports this information. This way, you don't need to have such magic configuration of each JVM instance on the server. Instead the local proxy can connect to all JVMs via JMX and then somehow expose this information remotely. I am not positive exactly how you would implement this, but something like this may be less work than what you otherwise have to do to expose all of your JVMs remotely via JMX.