【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为端口,自定义,保证是未使用的端口即可。jconsole通过这个端口来连接。
-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和端口进行连接

 

 

 

参考地址

jconsole远程监控linux上的springBoot服务:https://blog.csdn.net/myfmyfmyfmyf/article/details/88288388

 

 

posted @ 2020-05-14 10:40  harara  阅读(1001)  评论(0编辑  收藏  举报