JVM常用性能检测工具

jconsole/jvisualvm远程连接

1.开启JMX端口,程序启动加参数

java -Djava.rmi.server.hostname=192.168.17.11 
     -Dcom.sun.management.jmxremote 
     -Dcom.sun.management.jmxremote.port=1099
     -Dcom.sun.management.jmxremote.authenticate=false 
     -Dcom.sun.management.jmxremote.ssl=false

检查是否开启

[root@localhost ~]# netstat -ntpl|grep 1099
tcp6       0      0 :::1099                 :::*                    LISTEN      6902/java

2.配置权限文件

[root@localhost bin]# cd /usr/lib/jvm/java-1.8.0/jre/lib/management/
[root@localhost management]# cp jmxremote.password.template jmxremote.password
[root@localhost management]# vi jmxremote.password
monitorRole  QED
controlRole   R&D

3.配置文件权限

[root@localhost management]# chmod 600 jmxremote.password jmxremote.access

4.修改/etc/hosts文件,将127.0.0.1修改为真正的ip

192.168.17.11 basic localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

5.关闭防火墙或者开放对应端口

service iptables stop
chkconfig iptables off #永久关闭

Arthas 在线监测

参考Arthas官网

原文地址:https://www.cnblogs.com/farmersun/p/12452878.html