码迷,mamicode.com
首页 > 编程语言 > 详细

jconsole监控远程 spring boot程序

时间:2018-01-18 13:31:52      阅读:336      评论:0      收藏:0      [点我收藏+]

标签:系统环境   .com   post   gem   bsp   启动参数   技术   console   jconsole   

监控java 程序 增加启动参数 

java  \

-Djava.rmi.server.hostname=192.168.1.97 \

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

-jar ImagesCheck.jar  > image.log 2>&1 & 

 

由于启动参数过长,我们可以定义系统环境变量来表示 在/etc/profile 最后一行增加 

export JAVA_OPTS=‘-Djava.rmi.server.hostname=192.168.1.97 -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=1099 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false‘

然后 source /etc/profile 使文件生效。

启动时我们就可以用  nohup java $JAVA_OPTS -jar ImagesCheck.jar  > image.log 2>&1 &  这个脚本。

 

JMX端口为1099 ;

如果不设置服务器主机名 -Djava.rmi.server.hostname 到时候可能连不上。

在本机命令行输入jconsole命令调出界面

在远程进程中 输入 主机名:端口号即可

技术分享图片

 

技术分享图片

jconsole监控远程 spring boot程序

标签:系统环境   .com   post   gem   bsp   启动参数   技术   console   jconsole   

原文地址:https://www.cnblogs.com/zhangmingcheng/p/8309361.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!