java - 怎么在本机监控远程服务器上的JVM堆栈使用空间,GC详情,CPU,内存等参数?
PHP中文网
PHP中文网 2017-04-18 09:04:02
0
3
527

我本机安装了VisualVM,可以监控本机的Java应用。但是不清楚怎么配置参数去监考服务器的Java应用。

PHP中文网
PHP中文网

认证0级讲师

reply all(3)
黄舟

Modify the remote machine JRE configuration file:

1. Enter the $JAVA_HOMEjrelibmanagement directory
2. Rename jmxremote.password.template to jmxremote.password
3. Open jmxremote.password and remove the comments of monitorRole QED and controlRole R&D
4. Modify the configuration file of the monitored program, such as tomcat : Open $TOMCAT_HOMEbincatalina.sh and add

at the bottom of the comment
JAVA_OPTS="$JAVA_OPTS -Djava.rmi.server.hostname=这里是服务器IP
                      -Dcom.sun.management.jmxremote.port=1099自定义一个端口
                      -Dcom.sun.management.jmxremote.ssl=false 
                       Dcom.sun.management.jmxremote.authenticate=false"

5. Open VisualMV, click Remote, enter the server IP as the host name, click advanced settings to set the port, right-click the IP you just configured, select the JMX connection method, enter the port again after the IP, and click OK. .

刘奇

Are you unable to connect to the remote server locally?

PHPzhong

Recommend a remote java diagnostic tool

Using documentation

https://github.com/oldmanpushcart/greys-anatomy/wiki/greys-pdf
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template