Java jmx远程调优

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

配置指南

配置功能备注
-Dcom.sun.management.jmxremote.authenticateconnection authenticatetrue / false
-Dcom.sun.management.jmxremote.portjmx connection remote port1~65535
-Dcom.sun.management.jmxremote.local.onlyremote can connectiontrue / false
-Dcom.sun.management.jmxremote.sslenable ssl connectiontrue / false
-Djava.rmi.server.hostnamemulti eth chooseip / domain
-Dcom.sun.management.jmxremote.access.fileremote access rolesfile path
-Dcom.sun.management.jmxremote.password.fileremote authenticate file when auth config enablefile 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端口
授权配置
授权配置
已连接视图
已连接视图

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值