JDK-8024614 : Option to bind agent to specific interface.
  • Type: Enhancement
  • Component: core-svc
  • Sub-Component: java.lang.management
  • Affected Version: 7u40
  • Priority: P2
  • Status: Closed
  • Resolution: Duplicate
  • Submitted: 2013-09-11
  • Updated: 2023-12-14
  • Resolved: 2017-01-23
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
tbdResolved
Related Reports
Duplicate :  
Relates :  
Relates :  
Description
One commonly requested feature over the years have been to be able to bind the management agent to a specific interface. Today I got an e-mail from a customer requesting it yet again:

---
Hi Marcus,

Congratulation with the MissionControl release, we are lookng forward to start using it.

I hope that you at some point get the time to help me with my problem:

We have experienced when starting the JMX agent starts to listen 0.0.0.0:7091 and thus blocks the start of other JVMs on the same server node. Which setting should I use to restrict a JMX agent to only listen on a specific IP. My goal it to have multiple JMX agents (one for each JVM) running on port 7091 on a server node, e.g.:
JMX agent for JVM1: IP1:7091
JMX agent for JVM2: IP2:7091
etc.
---

It shouldn't be that hard to support this. Add another command line option and hack the RMI server socket factories.

(On a historic note, the old RMP management server in JRockit 1.4 and before supported this.)
Comments
JDK-6425769 has been fixed recently. I think this is what you want. After JDK-6425769 you can set the new "com.sun.management.jmxremote.host" and "com.sun.management.jmxremote.port" properties to allow for multiple management agents on the same host (binding to different IPs). The new "com.sun.management.jmxremote.host" property will make the agent bind to a specific IP.
11-02-2016

See also JDK-6425769 and JDK-6440708
15-09-2014

AFAIK, setting the property won't prevent the RMI listening on 0.0.0.0:<port> - it just will set the address for the callback to the generated stubs. "java.rmi.server.hostname: Hostname string; default value is the local host's IP address in "dotted-quad" format ... which is embedded into remote stubs created by this JVM when remote objects are exported. This can be used to control the effective IP address of RMI servers exported by multi-homed hosts. This property is read exactly once in the life of the JVM.[1] [1] Pitt & McNiff, java.rmi, The Remote Method Invocation Guide, Addison Wesley 2001, p.258."
26-09-2013

In the user example, the user used different JVM to run the RMI connectors on different IP addresses, there is a simple way to do this. as suggested in 4880793: set the system property "java.rmi.server.hostname"
26-09-2013