为了账号安全,请及时绑定邮箱和手机立即绑定

Java JMX远程调优一点就通

标签:
Java

java远程调优可采用两种方式进行连接,jmxjstatd,此文演示如何配置jmx进行连接调优。

配置指南
配置 功能 备注
-Dcom.sun.management.jmxremote.authenticate connection authenticate true / false
-Dcom.sun.management.jmxremote.port jmx connection remote port 1~65535
-Dcom.sun.management.jmxremote.local.only remote can connection true / false
-Dcom.sun.management.jmxremote.ssl enable ssl connection true / false
-Djava.rmi.server.hostname multi eth choose ip / domain
-Dcom.sun.management.jmxremote.access.file remote access roles file path
-Dcom.sun.management.jmxremote.password.file remote authenticate file when auth config enable file path
Demo1

不启用认证

java \
 -Dcom.sun.management.jmxremote.authenticate=false \
 -Dcom.sun.management.jmxremote.port=5555 \
 -Dcom.sun.management.jmxremote.ssl=false \
 -Djava.rmi.server.hostname=test.domain.dounine.com \
 -jar test-jar-1.0.jar
Demo2

启用用户认证

java \
 -Dcom.sun.management.jmxremote.authenticate=true \
 -Dcom.sun.management.jmxremote.port=5555 \
 -Dcom.sun.management.jmxremote.access.file=./jmxremote.access \
 -Dcom.sun.management.jmxremote.password.file=./jmxremote.password \
 -Dcom.sun.management.jmxremote.ssl=false \
 -Djava.rmi.server.hostname=test.domain.dounine.com \
 -jar test-jar-1.0.jar

编辑./jmxremote.access权限文件

dounine readwrite

编辑./jmxremote.password密码文件

dounine 你的密码

增加访问权限

chmod 400 ./jmxremote.access
chmod 400 ./jmxremote.password

启动jvisualvm或者jconsole

jvisualvm
# 或者
jconsole
jvisualvm

添加远程主机地扯
添加远程主机地扯
添加jmx端口
添加jmx端口
授权配置
授权配置
已连接视图
已连接视图

点击查看更多内容
1人点赞

若觉得本文不错,就分享一下吧!

评论

作者其他优质文章

正在加载中
感谢您的支持,我会继续努力的~
扫码打赏,你说多少就多少
赞赏金额会直接到老师账户
支付方式
打开微信扫一扫,即可进行扫码打赏哦
今天注册有机会得

100积分直接送

付费专栏免费学

大额优惠券免费领

立即参与 放弃机会
意见反馈 帮助中心 APP下载
官方微信

举报

0/150
提交
取消