• jvisualvm 远程连接 jvm


    1. jvivualvm 通过jmx远程连接

    17.1)需要在服务端加上

     -Dcom.sun.management.jmxremote -Djava.rmi.server.hostname=192.168.1.31 -Dcom.sun.management.jmxremote.port=9015 -Dcom.sun.management.jmxremote.rmi.port=9015 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false

    例如

    set JAVA_OPTS=-Xms%INITIAL_HEAP_SIZE% -Xmx%MAXIMUM_HEAP_SIZE% -Xss%STACK_SIZE%  -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=./22.txt -XX:NewRatio=2 -XX:SurvivorRatio=6 -Dcom.sun.management.jmxremote -Djava.rmi.server.hostname=192.168.1.31 -Dcom.sun.management.jmxremote.port=9015 -Dcom.sun.management.jmxremote.rmi.port=9015 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false

    -Dcom.sun.management.jmxremote 启用jmxremote

    -Djava.rmi.server.hostname=192.168.1.31   远程jmx服务的ip地址

    -Dcom.sun.management.jmxremote.port=9015  jmx本地端口

    -Dcom.sun.management.jmxremote.rmi.port=9015 jmx对外提供的远程端口

    -Dcom.sun.management.jmxremote.ssl=false不启用ssl连接

    -Dcom.sun.management.jmxremote.authenticate=false 不启用授权

    17.1.2)启动jvisualvm

    17.1.3)添加一个远程连接

     

    17.1.4)给远程添加一个jmx连接

     

     

     

    1. 带认证的jmx

     -Dcom.sun.management.jmxremote -Djava.rmi.server.hostname=192.168.1.31 -Dcom.sun.management.jmxremote.port=9015 -Dcom.sun.management.jmxremote.rmi.port=9015 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=true -Dcom.sun.management.jmxremote.password.file=./jmxremote.password  -Dcom.sun.management.jmxremote.access.file=./jmxremote.access

    -Dcom.sun.management.jmxremote.authenticate=true 设置为了true 开启

    -Dcom.sun.management.jmxremote.ssl=false 依然不开启

    Jmxremote.password 文件内容 guest 123456  guest使用用户名   123456是密码

    Jmxremote.access 文件内容 guest readonly   readonly只读

    chmod 600 jmxremote.password jmxremote.access

    例如

    JAVA_OPTS="-Xmx512m -Duser.timezone=Asia/Shanghai -Dwz.collection.task.workers=10  -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=./22.txt -XX:NewRatio=2 -XX:SurvivorRatio=6 -Dcom.sun.management.jmxremote -Djava.rmi.server.hostname=192.168.1.31 -Dcom.sun.management.jmxremote.port=9015 -Dcom.sun.management.jmxremote.rmi.port=9015 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=true -Dcom.sun.management.jmxremote.password.file=./jmxremote.password  -Dcom.sun.management.jmxremote.access.file=./jmxremote.access"

     

  • 相关阅读:
    JAVA架构之路(MySql事务隔离级别)
    【中秋国庆不断更】OpenHarmony定义可动画属性:@AnimatableExtend装饰器
    JAVA8-Stream的使用
    JUC系列(六) 线程池
    STM8S系列基于STVD开发,ADC不同精度采样示例
    leetcode_2300 咒语和药水的成功对数
    Windows自带虚拟机的使用方法
    前端国密SM4加密代码
    spark中的shuffle简述 那些会导致shuffle的算子
    C++PrimerPlus(第6版)中文版:Chapter13.3多态公有继承例子:usebrass1.cpp
  • 原文地址:https://blog.csdn.net/fivestar2009/article/details/125498249