search

Home  >  Q&A  >  body text

java - 怎么在本机监控远程服务器上的JVM堆栈使用空间,GC详情,CPU,内存等参数?

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

PHP中文网PHP中文网2769 days ago531

reply all(3)I'll reply

  • 黄舟

    黄舟2017-04-18 09:06:02

    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. .

    reply
    0
  • 怪我咯

    怪我咯2017-04-18 09:06:02

    Are you unable to connect to the remote server locally?

    reply
    0
  • PHPz

    PHPz2017-04-18 09:06:02

    Recommend a remote java diagnostic tool

    Using documentation

    https://github.com/oldmanpushcart/greys-anatomy/wiki/greys-pdf

    reply
    0
  • Cancelreply