【jvm】jconsole远程linux上的java进程

时间:2020-05-14
本文章向大家介绍【jvm】jconsole远程linux上的java进程,主要包括【jvm】jconsole远程linux上的java进程使用实例、应用技巧、基本知识点总结和需要注意事项,具有一定的参考价值,需要的朋友可以参考一下。

1、启动java进程的命令

在启动命令中添加如下信息

-Djava.rmi.server.hostname=192.169.1.71 -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=10099 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false 

说明 

-Djava.rmi.server.hostname为java程序运行所在的ip
-Dcom.sun.management.jmxremote.port为端口,自定义,保证是未使用的端口即可。监控工具通过这个端口进行连接来监控进程信息。
-Dcom.sun.management.jmxremote.authenticate=false表示在jconsole连接时可以不用输入账号和密码

例:

nohup java  -Xms128M -Xmx256M  -Djava.rmi.server.hostname=192.169.1.71 -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=10099 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -jar appgateway-1.0.0.9.jar --spring.config.location=/usr/local/csnsh/ums/appgateway/application-appgateway.properties >appgateway.txt &

2、使用jconsole通过启动命令中的ip和端口进行连接

原文地址:https://www.cnblogs.com/kiko2014551511/p/12887013.html