Can visualvm connect automatically via JMX to a remote process?

后端 未结 1 501
面向向阳花
面向向阳花 2021-02-04 12:13

I have a Java process running on a remote machine, and the process sets up some mbeans. I also have jstatd running on that machine as the same user as the Java proc

1条回答
  •  臣服心动
    2021-02-04 12:51

    Unfortunately there is no way to assign random JMX port to the remote application. You can start your remote application with

    -Dcom.sun.management.jmxremote.port=
    -Dcom.sun.management.jmxremote.ssl=false
    -Dcom.sun.management.jmxremote.authenticate=false
    

    and VisualVM will be able to read this configuration via Jvmstat (provide by jstatd) and open JMX connection to your remote application automatically. So you need to assign fixed port(s) to your remote application(s). Once you have it, everything will work fine and VisualVM will automatically connect to your application via JMX (in fact it will combine data from both Jvmstat and JMX).

    0 讨论(0)
提交回复
热议问题