繁体   English   中英

在生产中连接jmx时出错

[英]Error while connecting jmx on Production

出于某种原因,我无法使用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=<PATH>/jmxremote.password
-Dcom.sun.management.jmxremote.access.file=<PATH>/jmxremote.access

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM