JMX: can't connect from windows window to control JMX port on Linux system

I have a lot of experience with jconsole.exe and JVisualVM.exe in JDK1.6 and have connected thousands of times from the Windows JVM to the Windows JVM on another machine through JMX.remote, but it fails when I try to control a java instance that running on a Linux host (from a Windows host, and I tried listening to JMX on redhat and SUSE on Amazon EC2). I also tried using jconsole.exe and getting a similar error.

Is there a reason anyone might think why such a JMX connection would have a problem. Any ideas I can try? Has anyone “really” done this and can say that it will work if I persist?

The error I get from JVisualVM (when trying to connect remotely) looks something like this:

"Cannot connect using service:jmx:rmi:///jndi/rmi://<jmx service ip>:8001/jmxrmi"

My remote JMX service configuration looks like this:

 -Dcom.sun.management.jmxremote
 -Dcom.sun.management.jmxremote.port=8001
 -Dcom.sun.management.jmxremote.authenticate=false
 -Dcom.sun.management.jmxremote.hostname=<jmx service ip>

Found a similar question in this link , but he did not answer my question.

I checked that "iptables" is not included as a service and is not enabled, and therefore I am not creating a visualization, there is some kind of firewall blocking there. In addition, both windows and Linux machines reside on the 10.0.0.0 private internal subnet together. I can telnet to port 8001 to check it there and listen to it (netstat -ap) on linux machine.

+3
source share
4 answers

. java.rmi.server.hostname. JVM- Linux IP- . IP- URL- JMX.

+6

, , RMI , , . , , . ,

, jmxmp . jmxremote_optional.jar( Oracle, "JMX Remote API 1.0.1_04 Reference Implementation" ), , jvisualvm, .

google jmxmp, , , - http://pub.admc.com/howtos/jmx/distributed-chapt.html#jmxmp-sect , , , , jmxmp .

, . URL- jmx, jmxmp, , , , -D java, .

, .

Edit: , , , ( , ), ( , . ):

url=new JMXServiceURL(jmxurl);
this.server = JMXConnectorServerFactory.newJMXConnectorServer(url, null, ManagementFactory.getPlatformMBeanServer());
this.server.start();
+2

SSH- Linux- Windows-? http://oldsite.precedence.co.uk/nc/putty.html

, cygwin, ssh -f your-user@remote-server.com -L 7777:remote-server.com:123 -N, 7777 - Windows, 123 - Linux-, JMX.

jconsole visualvm Windows localhost:7777.

, iptables , , JMX SSHing Linux JMX- jconsole localhost ( Linux).

+1

.

, RMI - , , .

- SSH:

, , RMI - SSH, .

Good luck :-)

0
source

All Articles