arthas 使用 tunnel server
下载安装
下载最新的包, 我这里是 3.6.4
- arthas-boot.jar
- arthas-tunnel-server.jar
如果版本不对,可能 attach 不上
启动 tunnel server
java -jar arthas-tunnel-server.jar
连接 agent
java -jar arthas-boot.jar --tunnel-server ws://192.168.226.10:7777/ws --agent-id eee
进程 已经被占用
$ java -jar arthas-boot.jar --tunnel-server ws://192.168.226.10:7777/ws --agent-id eee
[INFO] arthas-boot version: 3.6.4
[INFO] Process 2797 already using port 3658
[INFO] Process 2797 already using port 8563
[INFO] Found existing java process, please choose one and input the serial number of the process, eg : 1. Then hit ENTER.
* [1]: 2797 math-game.jar
[2]: 10062 arthas-tunnel-server-3.6.4-fatjar.jar
*先 kill 进程, 再连接
连接成功时会显示 id:
$ java -jar arthas-boot.jar --tunnel-server ws://192.168.226.10:7777/ws --agent-id eee
[INFO] arthas-boot version: 3.6.4
[INFO] Found existing java process, please choose one and input the serial number of the process, eg : 1. Then hit ENTER.
* [1]: 11287 math-game.jar
[2]: 10062 arthas-tunnel-server-3.6.4-fatjar.jar
1
[INFO] arthas home: /root/arthas/arthas-bin
[INFO] Try to attach process 11287
[INFO] Attach process 11287 success.
[INFO] arthas-client connect 127.0.0.1 3658
,---. ,------. ,--------.,--. ,--. ,---. ,---.
/ O \ | .--. ''--. .--'| '--' | / O \ ' .-'
| .-. || '--'.' | | | .--. || .-. |`. `-.
| | | || |\ \ | | | | | || | | |.-' |
`--' `--'`--' '--' `--' `--' `--'`--' `--'`-----'
wiki https://arthas.aliyun.com/doc
tutorials https://arthas.aliyun.com/doc/arthas-tutorials.html
version 3.6.4
main_class
pid 11287
time 2022-08-16 13:20:24
id eee
访问管理端
http://192.168.226.10:8080/
, 代理端端口默认是 7777