【JConsole 连接配置】

来源:互联网 发布:淘宝保证金怎么补缴 编辑:程序博客网 时间:2024/05/09 16:51
远程监控配置

  JDK配置

  在%JAVA_HOME%/jre/lib/management目录下,jmxremote.password.template、jmxremote.password需要修改配置。具体步骤如下:

  1) 复制一份jmxremote.password.template文件,将其重命名为jmxremote.password,这就是控制远程连接的用户名密码的。

  2) 然后编辑jmxremote.password文件,修改下面两行,把热门主题之家注释#去掉:

  #monitorRole QED

  #controlRole R&D

  monitorRole是查看角色(也是登录用户名,在access文件中),拥有只读权限,QED是设置的密码。

  controlRole是控制用户(也是登录用户名,在access文件中),拥有读写权限,R&D是设置的密码。

  3) 最后chmod对这两个文件赋权,600就可以了。

  chmod 600 jmxremote.password.template

  chmod 600 jmxremote.password

  Tomcat启动配置

  编辑tomcat/bin/catalina.sh,在Execute The RequestedCommand这段注释上面加入下面这段代码,中间无换行:

  #注意hostname是tomcat所在服务器IP,port是监控端口。

  CATALINA_OPTS="$CATALINA_OPTS -Djava.rmi.server.hostname=192.168.0.3 -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=22222 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=true"

原创粉丝点击