Arthas工具包操作方式
#### 获取arthas全量包 并 启动arthas
curl -Lo arthas-packaging-latest-bin.zip 'https://arthas.aliyun.com/download/latest_version?mirror=aliyun'
unzip -d arthas-latest-bin arthas-packaging-latest-bin.zip
cd arthas-latest-bin && java -jar arthas-boot.jar
#### 进入arthas,操作热部署
①Arthas命令行:jad反编译文件
[arthas@14522]$ jad --source-only com.momo.arthas.HealthCheckController > /tmp/HealthCheckController.java
②Linux命令行:修改java文件
vim HealthCheckController.java
③Arthas命令行:拿到classLoader的Hash值
[arthas@14522]$ sc -d com.momo.arthas.HealthCheckController | grep classLoaderHash
classLoaderHash 21b8d17c
④Arthas命令行:mc命令编译java文件
[arthas@14522]$ mc -c 21b8d17c /tmp/HealthCheckController.java -d /tmp
Memory compiler output:
/tmp/com/momo/arthas/HealthCheckController.class
Affect(row-cnt:1) cost in 745 ms.