java - VisualVM through firewalls - RMI troubleshooting -
sorry question must have been asked many times, can't succeed in resolving problem. i've read lot of blogs, sites, forums, .... , didn't find solution in case.
case : need connect visualvm on box distant servers (tomcats, weblogics) performance / threads / memory monitoring. servers installed on (physical or virtual) machines protected firewall. large intervals of ports open in firewall , can used, not ports.
tests
- i've tried direct connections through jmx in visualvm, using following jvm options on server-side @ server startup :
-djava.rmi.server.hostname=[hostname] -dcom.sun.management.jmxremote -dcom.sun.management.jmxremote.port=[port] -dcom.sun.management.jmxremote.ssl=false -dcom.sun.management.jmxremote.authenticate=false
i've precised hostname because network hostname , ip address of server not same network of remote server.
no success, visualvm seems searching unknown server.
tried starting jstatd on server-side on port accessible (-p option) box (telnet on port works), when launching visualvm on host jstatd port, still seems waiting unreachable.... same behavior jps connecting remote host.
tried using same tools on server less network protection, , works. have seen connections between box , server , done on ports different i've specified jstatd. understand port needed first communication (kind of handshake) , real communications done on other ports, not predictible (ex: 60305, 55197, ...). not sure understand how rmi works.
please, me, i'm going crazy !
unfortunately jmx tries open ports other 1 configure. yesterday succeeded connecting tomcat behind firewall via jmx. 2 tricky parts are:
put file called
jmxremote.access
incatalina_home/conf
, contains following lines:monitorrole readonly controlrole readwrite
in
server.xml
set ports used jmx, via special tomcat listener (catalina-jmx-remote.jar required in /lib):<listener classname="org.apache.catalina.mbeans.jmxremotelifecyclelistener" rmiregistryportplatform="9009" rmiserverportplatform="9010" />
then open these 2 ports on firewall. works. that's tomcat.
another option use ssh tunnelling. in short - connect via ssh , configure forward local port (where jmx client running) ports on other side of tunnel.
references:
Comments
Post a Comment