Jconsole监控 window下tomcat的JVM【带用户认证方式】(未完成)

来源:互联网 发布:淘宝客怎么贷 编辑:程序博客网 时间:2024/06/16 00:25

http://blog.csdn.net/rainyspring4540/article/details/65434854

上篇文章谢啦不带认证方式的配置,挺简单的,而带认证的方式还是没弄成功,是在没时间了,先记录下既有成果,以后再弄


环境 window7 、tomcat7、jdk7

目标一:本地使用jconsole监测通过startup.bat方式启动的tomcat服务(带用户认证方式)

目标二:远程使用jconsole监测通过startup.bat方式启动的tomcat服务(带用户认证方式)

目标三:本地使用jconsole监测通过window服务形式启动的tomcat服务(带用户认证方式)

目标四:远程使用jconsole监测通过window服务形式启动的tomcat服务(带用户认证方式)


目前仅测试目标1为例,其他的参考“无认证的”方式http://blog.csdn.net/rainyspring4540/article/details/65434854  配置都差不多。

在catalina.bat中的代码如下:

set JAVA_OPTS=%JAVA_OPTS% -Djava.rmi.server.hostname=192.168.0.234set JAVA_OPTS=%JAVA_OPTS% -Dcom.sun.management.jmxremoteset JAVA_OPTS=%JAVA_OPTS% -Dcom.sun.management.jmxremote.port=8999 -Dcom.sun.management.jmxremote.login.config=monitorRole set JAVA_OPTS=%JAVA_OPTS% -Dcom.sun.management.jmxremote.authenticate=true -Dcom.sun.management.jmxremote.ssl=falseset JAVA_OPTS=%JAVA_OPTS% -Dcom.sun.management.jmxremote.local.only=falseset JAVA_OPTS=%JAVA_OPTS% -Dcom.sun.management.jmxremote.password.file=D:\common\Java\jdk1.7.0_79\jre\lib\management\jmxremote.passwordset JAVA_OPTS=%JAVA_OPTS% -Dcom.sun.management.jmxremote.access.file=D:\common\Java\jdk1.7.0_79\jre\lib\management\jmxremote.access

其中
-Dcom.sun.management.jmxremote.login.config=monitorRole
必须有,不然tomcat服务起不来,一闪而过,后面的名字任意,不太了解啥含义

-Dcom.sun.management.jmxremote.authenticate=true
这是带认证的必须

-Dcom.sun.management.jmxremote.local.only=false
是允许其他用户连接

-Dcom.sun.management.jmxremote.password.file
是认证的用户密码文件

-Dcom.sun.management.jmxremote.access.file
是用户权限文件

如果 不指定上面2个文件,会读取默认地址,是tomcat使用的JRE的

jre\lib\management\jmxremote.password

jre\lib\management\jmxremote.access
提示下:查看采用startup方式启动的tomcat服务使用的哪个jdk的方法:切入到tomcat的bin目录,运行version.bat

所有配置属性的解释 ,查看jdk/jre/lib/management/management.properties,全是英文。。。。勉强能看懂

0 0
原创粉丝点击