现在的位置: 首页 > 综合 > 正文

JConsole 连接配置

2013年08月06日 ⁄ 综合 ⁄ 共 796字 ⁄ 字号 评论关闭

远程监控配置

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"

抱歉!评论已关闭.