java jmx连接不上_java – 在生产时连接jmx时出错

出于某种原因,我无法使用VisualVM在生产服务器上连接 java pid.

我在setenv.sh文件中传递了jvm参数:

export JAVA_OPTS="-Dcom.sun.management.jmxremote=true \

-Dcom.sun.management.jmxremote.port=9999\

-Dcom.sun.management.jmxremote.authenticate=false\

-Dcom.sun.management.jmxremote.ssl=false \

-Djava.rmi.server.hostname=192.168.1.2"

并将此文件放入$/usr/share / tomcat7 / bin /目录.

并且为了验证目的,将jmxremote.password和jmxremote.access文件放入“/ var / lib / tomcat7 / conf /”目录中.

File permissions :

**$sudo chown tomcat7:tomcat7 /var/lib/tomcat7/conf/jmxremote.*** is ensuring that both file owned by tomcat7

**$sudo chmod 0600 /var/lib/tomcat7/conf/jmxremote.*** // access right for tomcat7

$sudo cat jmxremote.password

admin alonegk

$sudo cat jmxremote.access

admin readwrite

同样的事情在我在dev服务器以及我的localhost上运行时运行良好.

谢谢你的期待.

最佳答案 请尝试以下内容:

export JAVA_OPTS="-Dcom.sun.management.jmxremote \

-Dcom.sun.management.jmxremote.port=9999\

-Dcom.sun.management.jmxremote.authenticate=false\

-Dcom.sun.management.jmxremote.ssl=false \

-Djava.rmi.server.hostname=192.168.1.2"

由于身份验证设置为false,因此用户名和密码在此处没有任何意义.

如果您想使用用户名和密码,则应附加以下两个字符串:

-Dcom.sun.management.jmxremote.password.file=/jmxremote.password

-Dcom.sun.management.jmxremote.access.file=/jmxremote.access

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值