JMX管理Tomcat和Resin

以下均为在启动容器的JAVA的命令行参数中加入相应参数设置

(1)无限制访问
-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.port=9000
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.ssl=false

 

(2)通过密码访问
-Dcom.sun.management.jmxremote

-Dcom.sun.management.jmxremote.port=9000

-Dcom.sun.management.jmxremote.authenticate=true

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

-Dcom.sun.management.jmxremote.password.file=D:/temp/jmxremote.password
-Dcom.sun.management.jmxremote.access.file=D:/temp/jmxremote.access
其中password文件,如:
user1 pwd1
user2 pwd2

其中access文件,如:

user1 readonly

user2 readwrite
要注意:password和access文件的权限,jmxremote.password只允许拥有者访问

(3)可以用jconsole来访问JMX

(4)用jconsole连接远程服务时, IP地址和port都输入正确的情况下,仍然是连接失败
这是因为服务端解析机器IP时定向到了127.0.0.1,可能是调用hostname -i或是读/etc/hosts
解决:vi /etc/hosts,将localhost对应的127.0.0.1改为你机器的真实IP即可;有时也需要在你的jconsole机器上配置hosts,将IP和主机名进行绑定

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 3
    评论
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值