arthas tomcat 监控

arthas tomcat 监控

报错信息:

java -jar arthas-boot.jar

[INFO] arthas-boot version: 3.1.7
[INFO] Found existing java process, please choose one and hit RETURN.
* [1]: 28821 org.apache.catalina.startup.Bootstrap
  [2]: 24748 com.alibaba.otter.canal.deployer.CanalLauncher
1
[INFO] arthas home: /root/.arthas/lib/3.1.7/arthas
[INFO] Try to attach process 28821
[ERROR] Start arthas failed, exception stack trace:
com.sun.tools.attach.AttachNotSupportedException: Unable to open socket file: target process not responding or HotSpot VM not loaded
        at sun.tools.attach.LinuxVirtualMachine.<init>(LinuxVirtualMachine.java:106)
        at sun.tools.attach.LinuxAttachProvider.attachVirtualMachine(LinuxAttachProvider.java:78)
        at com.sun.tools.attach.VirtualMachine.attach(VirtualMachine.java:250)
        at com.taobao.arthas.core.Arthas.attachAgent(Arthas.java:85)
        at com.taobao.arthas.core.Arthas.<init>(Arthas.java:28)
        at com.taobao.arthas.core.Arthas.main(Arthas.java:123)
[ERROR] attach fail, targetPid: 28821

解决方案

cd /tmp && curl -O https://arthas.aliyun.com/arthas-boot.jar
ps aux | grep tomcat 找到PID
sudo -u tomcat -s /bin/bash -c 'java -jar /tmp/arthas-boot.jar PID'

版权声明:本文为ainizfb原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。