如何让JMX绑定到特定的接口? [英] How to have JMX bind to a specific interface?

查看:156
本文介绍了如何让JMX绑定到特定的接口?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在使用 com.sun.management.jmxremote。* 属性启动我的Java VM,以便我可以通过它连接到它JConsole用于管理和监控。不幸的是,它会监听机器上的所有接口(IP地址)。

I am currently starting my Java VM with the com.sun.management.jmxremote.* properties so that I can connect to it via JConsole for management and monitoring. Unfortunately, it listens on all interfaces (IP addresses) on the machine.

在我们的环境中,通常情况下,机器上运行的Java VM不止一个同时。虽然可以告诉JMX监听不同的TCP端口(使用 com.sun.management.jmxremote.port ),但让JMX使用标准JMX会更好端口只是绑定到一个特定的IP地址(而不是所有IP地址)。

In our environment, there are often cases where there is more than one Java VM running on a machine at the same time. While it's possible to tell JMX to listen on different TCP ports (using com.sun.management.jmxremote.port), it would be nice to instead have JMX use the standard JMX port and just bind to a specific IP address (rather than all of them).

这样可以更容易地找出我们通过JConsole连接的VM (因为每个VM都有效地拥有自己的IP地址)。有没有人想出如何让JMX监听单个IP地址或主机名?

This would make it much easier to figure out which VM we're connecting to via JConsole (since each VM effectively "owns" its own IP address). Has anyone figured out how to make JMX listen on a single IP address or hostname?

推荐答案

如果有其他人会失去他的神经有了这个...... 10年后,他们终于修复了它!

If anyone else will be losing his nerves with this ... After 10 years, they finally fixed it!

自Java 8u102 -Dcom.sun.management.jmxremote.host 绑定到选定的IP

Since Java 8u102 -Dcom.sun.management.jmxremote.host binds to the selected IP

请参阅: https://bugs.openjdk.java.net/browse/JDK-6425769

这篇关于如何让JMX绑定到特定的接口?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆