Arthas 远程调试

Web Console

  • 在机器A(需要调试的目标机器)运行

java -jar arthas-boot.jar --telnet-port 9998 --http-port 9000 --target-ip 172.19.110.42

需要对外提供服务,要指定A的公网IP --target-ip xx.xx.xx.xx

Arthas Tunnel

  • 在机器A(tunnel-server)运行

java -jar arthas-tunnel-server.jar

  • 在机器B(需要调试的目标机器)运行

java -jar arthas-boot.jar --tunnel-server ws://127.0.0.1:7777/ws
ws://127.0.0.1:7777/ws IP,端口为 tunnel-server 监听IP、端口

其中id就是AgentId,浏览器访问需要

原理
+---------+ +----------------------+ +----------------------+ +--------------+
| browser <-----> arthas tunnel server | <-----> arthas tunnel client <--- -> arthas agent |
|---------+ +----------------------+ +----------------------+ +--------------+

arthas tunnel server可以理解为一个网关或代理

原文地址:https://www.cnblogs.com/lanqie/p/14155600.html