zoukankan      html  css  js  c++  java
  • jvisualvm not suppout this jvm

    Visual GC uses the jvmstat technology to gather data from the monitored application. This means that the monitored application must either run locally or there must be a jstatd agent up and running on the remote system. For remote applications added using the JMX connection you will only see the "Not supported for this JVM" message - there's no jvmstat available.

    监控远程Java进程的JVM有两个条件:
    1、应用运行在本地环境。
    2、远程系统启动了jstatd agent

    VisualVM监控远程JVM是通过RMI服务器来实现的,因此需要在被监控的远程服务器上启动RMI服务

    需要在被监控的服务器上面,通过jstatd来启动RMI服务。
    在/usr/local/java/bin/目录下新建个文件jstatd.all.policy 文件内容如下: 

    # vi jstatd.all.policy
        grant codebase "file:${java.home}/../lib/tools.jar" {  
            permission java.security.AllPermission;  
        };  

    然后通过执行如下的命令启动被监控服务器上的RMI服务:
    # jstatd -J-Djava.security.policy=jstatd.all.policy &
    如果没有添加jstatd.all.policy会报错信息:
    Could not create remote object
    access denied (java.util.PropertyPermission java.rmi.server.ignoreSubClasses write)
    java.security.AccessControlException: access denied (java.util.PropertyPermission java.rmi.server.ignoreSubClasses write)
            at java.security.AccessControlContext.checkPermission(AccessControlContext.java:374)
            at java.security.AccessController.checkPermission(AccessController.java:546)
            at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
            at java.lang.System.setProperty(System.java:725)
            at sun.tools.jstatd.Jstatd.main(Jstatd.java:122)
            
            
    默认端口1099,可设置端口为2020
    ./jstatd -J-Djava.security.policy=jstatd.all.policy -p 2020 &

    jstatd会跟本地的一个ip地址绑定(hostname -i显示的ip地址),可以启动时指定绑定IP:
    # jstatd -J-Djava.rmi.server.hostname=192.168.1.115 -J-Djava.security.policy=jstatd.all.policy -p 11099 &

    如果绑定的hostname不对可以修改:
    # hostname newhostname

  • 相关阅读:
    在Oracle中添加用户 赋权 修改暗码 解锁
    Ubuntu Linux 8.04 Vsftp 假造用户设置
    用一个实例讲解DB2数据库游标轮回的成果
    解说Oracle数据库自动增长列的完成过程
    MSN登录错误“80072efd”解决办法
    再学 GDI+[61]: 路径画刷(1) SetCenterColor、SetSurroundColors
    WinAPI: 测试 BitBlt
    两个 CopyRect
    再学 GDI+[58]: 路径 保存与读取路径数据
    再学 GDI+[62]: 路径画刷(2) SetCenterPoint、GetCenterPoint
  • 原文地址:https://www.cnblogs.com/aiguang/p/3554613.html
Copyright © 2011-2022 走看看