其他分享
首页 > 其他分享> > 使用jconsole工具对应用进行远程JVM监控

使用jconsole工具对应用进行远程JVM监控

作者:互联网

  1. 找到JDK的安装目录

  2. JDK安装目录下找到 jconsole 工具

图片

3. 服务器上启动应用时添加如下参数:

-Djava.rmi.server.hostname=172.26.40.40 #远程服务器ip,即本机ip
-Dcom.sun.management.jmxremote #允许JMX远程调用
-Dcom.sun.management.jmxremote.port=3214 #自定义jmx 端口号
-Dcom.sun.management.jmxremote.ssl=false # 是否需要ssl 安全连接方式
-Dcom.sun.management.jmxremote.authenticate=false #是否需要秘钥

例如:

/app/soft/jdk/bin/java -jar -Djava.rmi.server.hostname=172.18.40.45 -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=3214 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false vesta_server.jar

4. 打开jconsole工具

图片

① 点击连接

② 选择远程进程

③ 输入远程服务器的ip与配置的端口(注意是刚才配置 jmx 端口号)

④ 服务器的 登录用户

⑤ 服务器的 登录密码

⑥ 点击连接

5. 最终连接成功

图片

通过采集的数据对应用进行分析

图片

关注我,一起学习更多知识

某信:程序员小邹

标签:management,false,sun,Dcom,jconsole,JVM,服务器,jmxremote,远程
来源: https://blog.csdn.net/qq_36698385/article/details/118888342