Remote monitoring of Tomcat 7 server using VisualVM and SSH

Sorry if this is a repeat of the question asked earlier, but I tried the solutions provided here and elsewhere, and none of them seem to work for me.

The script . I need to profile the Tomcat 7 server that lives behind the firewall. I have only SSH access to this server. The profiling tool is Visualvm and there is no GUI installed on these servers. Both the server and the machine I'm trying to connect to start the Ubuntu 10.04 LTS server.

Possible solution . Using visualvm over SSH tunnels seems possible, and the link below provides a fairly detailed guide to this:

Tomcat + VisualVM + SSH Tutorial

I also added the jmxremote.access file to / conf in Tomcat with the following two lines:

monitorRole readonly
controlRole readwrite

Problem . I followed the steps in this article and everything seems to be beautiful. I can connect to the jmx ports on the server locally (from the server) using jmxterm and the connection string specified in the manual.

I configured the local tomcat according to the manual as a test, and Visualvm had no problems connecting to this tomcat instance using the connection string.

However, VisualVM will not connect to the remote server through the SSH tunnel. I tried JConsole as it is simpler and has better logging capabilities and I get the following message sequence:

FINER: [javax.management.remote.rmi.RMIConnector: jmxServiceURL=service:jmx:rmi://localhost:12009/jndi/rmi://localhost:12008/jmxrmi]  connecting...
FINER: [javax.management.remote.rmi.RMIConnector: jmxServiceURL=service:jmx:rmi://localhost:12009/jndi/rmi://localhost:12008/jmxrmi] finding stub...
FINER: [javax.management.remote.rmi.RMIConnector: jmxServiceURL=service:jmx:rmi://localhost:12009/jndi/rmi://localhost:12008/jmxrmi] connecting stub...
FINER: [javax.management.remote.rmi.RMIConnector: jmxServiceURL=service:jmx:rmi://localhost:12009/jndi/rmi://localhost:12008/jmxrmi] getting connection...
FINER: [javax.management.remote.rmi.RMIConnector: jmxServiceURL=service:jmx:rmi://localhost:12009/jndi/rmi://localhost:12008/jmxrmi] failed to connect: java.rmi.NoSuchObjectException: no such object in table

Any ideas on what I did wrong here? Any help is much appreciated!

Thank.

+5
2

, , , , - , jmx-rmi, , , RMI. Tomcat :

  • RMI , localhost: 12009.
  • RMI localhost: 12008.

, RMI, jmx-, localhost: 12009, .

SSH, , tomcat 12008, , , localhost:12008 tomcatServer:12008, , .

, , , localhost:12009 .

, : 12008 localhost: 12009 tomcatServer: 12008 tomcatServer: 12009.

- RMI jmx - Jolokia (HTTP), JMX-WS (HTTP WebService) JMXMP (Socket). SSH. JMXMP, github, OpenDMK, mavenized builds. jmx-optional.

+2

! - . , , , , , : https://www.liferay.com/web/thiago.moreira/blog/-/blogs/how-to-monitor-liferay-tomcat-remotely-through-firewalls-using-visualvm ( , - Tomcat 7 VisualVM 1.3.8). Tomcat CentOS 6.6, - Mac (, - ). .

0

All Articles