zoukankan      html  css  js  c++  java
  • java virtualVM远程配置方法

    在/etc/hosts中设置主机名和ip的对应关系   ip为用java virtualVM链接服务器的ip

       如:      10.175.0.191 host-ai

    #rmiregistry不知道干嘛的。但是不起的话,后面statd会报Connection refused to host: 10.175.0.191;
    #起来后会监听1099端口。
    ./rmiregistry &

    #jstatd是一个监控 JVM 从创建到销毁过程中资源占用情况并提供远程监控接口的 RMI ( Remote Method Invocation ,远程方法调用)服务器程序,它是一个 Daemon 程序,要保证远程监控软件连接到本地的话需要 jstatd 始终保持运行。
    #jstatd启动后,启动用户有权限访问的所有JVM进程都可以监控到。
    #jstatd运行需要通过 -J-Djava.security.policy=*** 指定安全策略,因此我们需要在服务器上建立一个指定安全策略的文件
    #起来后会监听某个端口,virsualVM就是跟这个端口打交道。
    echo "grant codebase "file:${java.home}/../lib/tools.jar" {
    permission java.security.AllPermission;
    };" > java.security.allpolicy

    ./jstatd -J-Djava.security.policy=java.security.allpolicy -nr &

    在java进程启动参数中添加:

    -Dcom.sun.management.jmxremote.port=8999 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false

    重启java进程

    在java virtualVM客户端中添加远程主机即可。

     
  • 相关阅读:
    The best programmers are the quickest to Google
    NetBeans 时事通讯(刊号 # 117 Sep 16, 2010)
    Apache HttpClient 4.0.3 GA 发布
    warning LNK4070的解决办法
    看泡沫
    早秋精神
    NetBeans 时事通讯(刊号 # 117 Sep 16, 2010)
    Maven 3.0 RC1 发布
    关于类的数据成员的访问权限设计的一些思考
    看泡沫
  • 原文地址:https://www.cnblogs.com/aoyihuashao/p/8796413.html
Copyright © 2011-2022 走看看