feat: restrict boot to use 3.x version and support website version switching (#2884)

3.x
SiuHui 5 months ago committed by GitHub
parent 2cf87ea157
commit 479f38b9db
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -8,7 +8,7 @@ about: 提交Arthas Bug/使用疑问,使用这个模板
### 环境信息 ### 环境信息
* `arthas-boot.jar` 或者 `as.sh` 的版本: xxx * `arthas-boot3.jar` 或者 `as3.sh` 的版本: xxx
* Arthas 版本: xxx * Arthas 版本: xxx
* 操作系统版本: xxx * 操作系统版本: xxx
* 目标进程的JVM版本: xxx * 目标进程的JVM版本: xxx

@ -32,23 +32,23 @@ Recommend to use [`as-package.sh`](as-package.sh) to package, which will auto-in
* windows need to install gcc * windows need to install gcc
F.Y.I F.Y.I
1. when using [`as.sh`](https://github.com/alibaba/arthas/blob/master/bin/as.sh) to start Arthas, it will get the latest version under `~/.arthas/lib`; 1. when using [`as3.sh`](https://github.com/alibaba/arthas/blob/master/bin/as3.sh) to start Arthas, it will get the latest version under `~/.arthas/lib`;
2. when [`as-package.sh`](as-package.sh) packaging, it will get the version from `pom.xml` and suffix it with the current timestamp e.g. `3.0.5.20180917161808`. 2. when [`as-package.sh`](as-package.sh) packaging, it will get the version from `pom.xml` and suffix it with the current timestamp e.g. `3.0.5.20180917161808`.
You can also use `./mvnw clean package -DskipTests` to package and generate a `zip` under `packaging/target/` but remember when `as.sh` starts, it load the version under `~/.arthas/lib`. You can also use `./mvnw clean package -DskipTests` to package and generate a `zip` under `packaging/target/` but remember when `as3.sh` starts, it load the version under `~/.arthas/lib`.
### Start Arthas in specified version ### Start Arthas in specified version
When there are several different version, you can use `--use-version` to specify the version of Arthas to start your debug. When there are several different version, you can use `--use-version` to specify the version of Arthas to start your debug.
```bash ```bash
./as.sh --use-version 3.0.5.20180919185025 ./as3.sh --use-version 3.0.5.20180919185025
``` ```
Tip: you can use `--versions` to list all available versions. Tip: you can use `--versions` to list all available versions.
```bash ```bash
./as.sh --versions ./as3.sh --versions
``` ```
### Debug ### Debug
@ -97,22 +97,22 @@ Tip: you can use `--versions` to list all available versions.
* windows需要安装gcc * windows需要安装gcc
`as.sh`在启动时,会对`~/.arthas/lib`下面的目录排序,取最新的版本。`as-package.sh`在打包时,会取`pom.xml`里的版本号,再拼接上当前时间,比如: `3.0.5.20180917161808`,这样子排序时取的就是最新的版本。 `as3.sh`在启动时,会对`~/.arthas/lib`下面的目录排序,取最新的版本。`as-package.sh`在打包时,会取`pom.xml`里的版本号,再拼接上当前时间,比如: `3.0.5.20180917161808`,这样子排序时取的就是最新的版本。
也可以直接 `./mvnw clean package -DskipTests`打包生成的zip在 `packaging/target/` 下面。但是注意`as.sh`启动加载的是`~/.arthas/lib`下面的版本。 也可以直接 `./mvnw clean package -DskipTests`打包生成的zip在 `packaging/target/` 下面。但是注意`as3.sh`启动加载的是`~/.arthas/lib`下面的版本。
### 启动指定版本的arthas ### 启动指定版本的arthas
本地开发时,可能会产生多个版本,可以用 `--use-version` 参数来指定版本,比如 本地开发时,可能会产生多个版本,可以用 `--use-version` 参数来指定版本,比如
```bash ```bash
./as.sh --use-version 3.0.5.20180919185025 ./as3.sh --use-version 3.0.5.20180919185025
``` ```
可以用`--versions`参数来列出所有版本: 可以用`--versions`参数来列出所有版本:
```bash ```bash
./as.sh --versions ./as3.sh --versions
``` ```
### Debug ### Debug
@ -133,7 +133,7 @@ Tip: you can use `--versions` to list all available versions.
发布release版本流程 发布release版本流程
* 如果 arthas-vmtool 有更新则需要手动触发action构建后会把新的动态库文件提交到 lib 目录。 https://github.com/alibaba/arthas/actions/workflows/build-vmtool.yaml * 如果 arthas-vmtool 有更新则需要手动触发action构建后会把新的动态库文件提交到 lib 目录。 https://github.com/alibaba/arthas/actions/workflows/build-vmtool.yaml
* 修改`as.sh`里的版本,最后修改日期, `Bootstrap.java`里的版本Dockerfile里的版本 * 修改`as3.sh`里的版本,最后修改日期, `Bootstrap.java`里的版本Dockerfile里的版本
* 修改本地的maven settings.xml * 修改本地的maven settings.xml
* mvn clean deploy -DskipTests -P full -P release * mvn clean deploy -DskipTests -P full -P release
@ -146,7 +146,7 @@ Tip: you can use `--versions` to list all available versions.
版本号信息地址: https://maven.aliyun.com/repository/public/com/taobao/arthas/arthas-packaging/maven-metadata.xml 版本号信息地址: https://maven.aliyun.com/repository/public/com/taobao/arthas/arthas-packaging/maven-metadata.xml
* 打上tagpush tag到仓库上 * 打上tagpush tag到仓库上
* 需要更新 gh-pages 分支下面的 arthas-boot.jar/math-game.jar/as.sh ,下载 doc.zip解压覆盖掉文档的更新 * 需要更新 gh-pages 分支下面的 arthas-boot3.jar/math-game.jar/as3.sh ,下载 doc.zip解压覆盖掉文档的更新
* 需要更新docker镜像push新的taghttps://hub.docker.com/r/hengyunabc/arthas/tags?page=1&ordering=last_updated * 需要更新docker镜像push新的taghttps://hub.docker.com/r/hengyunabc/arthas/tags?page=1&ordering=last_updated
以 3.6.5 版本为例: 以 3.6.5 版本为例:

@ -4,7 +4,7 @@
[![Build Status](https://github.com/alibaba/arthas/workflows/JavaCI/badge.svg)](https://github.com/alibaba/arthas/actions) [![Build Status](https://github.com/alibaba/arthas/workflows/JavaCI/badge.svg)](https://github.com/alibaba/arthas/actions)
[![codecov](https://codecov.io/gh/alibaba/arthas/branch/master/graph/badge.svg)](https://codecov.io/gh/alibaba/arthas) [![codecov](https://codecov.io/gh/alibaba/arthas/branch/master/graph/badge.svg)](https://codecov.io/gh/alibaba/arthas)
[![maven](https://img.shields.io/maven-central/v/com.taobao.arthas/arthas-packaging.svg)](https://search.maven.org/search?q=g:com.taobao.arthas) [![maven](https://img.shields.io/maven-central/v/com.taobao.arthas/arthas-packaging?versionPrefix=3)](https://search.maven.org/search?q=g:com.taobao.arthas)
![license](https://img.shields.io/github/license/alibaba/arthas.svg) ![license](https://img.shields.io/github/license/alibaba/arthas.svg)
[![Average time to resolve an issue](http://isitmaintained.com/badge/resolution/alibaba/arthas.svg)](http://isitmaintained.com/project/alibaba/arthas "Average time to resolve an issue") [![Average time to resolve an issue](http://isitmaintained.com/badge/resolution/alibaba/arthas.svg)](http://isitmaintained.com/project/alibaba/arthas "Average time to resolve an issue")
[![Percentage of issues still open](http://isitmaintained.com/badge/open/alibaba/arthas.svg)](http://isitmaintained.com/project/alibaba/arthas "Percentage of issues still open") [![Percentage of issues still open](http://isitmaintained.com/badge/open/alibaba/arthas.svg)](http://isitmaintained.com/project/alibaba/arthas "Percentage of issues still open")
@ -43,55 +43,52 @@ Arthas was built to solve these issues. A developer can troubleshoot your produc
* Supports JDK 6+. * Supports JDK 6+.
* Supports Linux/Mac/Windows. * Supports Linux/Mac/Windows.
### [Online Tutorials(Recommended)](https://arthas.aliyun.com/3.x/doc/arthas-tutorials.html?language=en)
### [Online Tutorials(Recommended)](https://arthas.aliyun.com/doc/arthas-tutorials.html?language=en)
* [Usages](tutorials/katacoda/README.md#online-tutorial-usages)
### Quick start ### Quick start
#### Use `arthas-boot`(Recommended) #### Use `arthas-boot3`(Recommended)
Download`arthas-boot.jar`Start with `java` command: Download`arthas-boot3.jar`Start with `java` command:
```bash ```bash
curl -O https://arthas.aliyun.com/arthas-boot.jar curl -O https://arthas.aliyun.com/arthas-boot3.jar
java -jar arthas-boot.jar java -jar arthas-boot3.jar
``` ```
Print usage: Print usage:
```bash ```bash
java -jar arthas-boot.jar -h java -jar arthas-boot3.jar -h
``` ```
#### Use `as.sh` #### Use `as3.sh`
You can install Arthas with one single line command on Linux, Unix, and Mac. Copy the following command and paste it into the command line, then press *Enter* to run: You can install Arthas with one single line command on Linux, Unix, and Mac. Copy the following command and paste it into the command line, then press *Enter* to run:
```bash ```bash
curl -L https://arthas.aliyun.com/install.sh | sh curl -L https://arthas.aliyun.com/install3.sh | sh
``` ```
The command above will download the bootstrap script `as.sh` to the current directory. You can move it any other place you want, or put its location in `$PATH`. The command above will download the bootstrap script `as3.sh` to the current directory. You can move it any other place you want, or put its location in `$PATH`.
You can enter its interactive interface by executing `as.sh`, or execute `as.sh -h` for more help information. You can enter its interactive interface by executing `as3.sh`, or execute `as3.sh -h` for more help information.
### Documentation ### Documentation
* [Online Tutorials(Recommended)](https://arthas.aliyun.com/doc/arthas-tutorials.html?language=en) * [Online Tutorials(Recommended)](https://arthas.aliyun.com/3.x/doc/arthas-tutorials.html?language=en)
* [User manual](https://arthas.aliyun.com/doc/en) * [User manual](https://arthas.aliyun.com/3.x/doc/en)
* [Installation](https://arthas.aliyun.com/doc/en/install-detail.html) * [Installation](https://arthas.aliyun.com/3.x/doc/en/install-detail.html)
* [Download](https://arthas.aliyun.com/doc/en/download.html) * [Download](https://arthas.aliyun.com/3.x/doc/en/download.html)
* [Quick start](https://arthas.aliyun.com/doc/en/quick-start.html) * [Quick start](https://arthas.aliyun.com/3.x/doc/en/quick-start.html)
* [Advanced usage](https://arthas.aliyun.com/doc/en/advanced-use.html) * [Advanced usage](https://arthas.aliyun.com/3.x/doc/en/advanced-use.html)
* [Commands](https://arthas.aliyun.com/doc/en/commands.html) * [Commands](https://arthas.aliyun.com/3.x/doc/en/commands.html)
* [WebConsole](https://arthas.aliyun.com/doc/en/web-console.html) * [WebConsole](https://arthas.aliyun.com/3.x/doc/en/web-console.html)
* [Docker](https://arthas.aliyun.com/doc/en/docker.html) * [Docker](https://arthas.aliyun.com/3.x/doc/en/docker.html)
* [Arthas Spring Boot Starter](https://arthas.aliyun.com/doc/en/spring-boot-starter.html) * [Arthas Spring Boot Starter](https://arthas.aliyun.com/3.x/doc/en/spring-boot-starter.html)
* [User cases](https://github.com/alibaba/arthas/issues?q=label%3Auser-case) * [User cases](https://github.com/alibaba/arthas/issues?q=label%3Auser-case)
* [FAQ](https://arthas.aliyun.com/doc/en/faq) * [FAQ](https://arthas.aliyun.com/3.x/doc/en/faq)
* [Compile and debug/How to contribute](https://github.com/alibaba/arthas/blob/master/CONTRIBUTING.md) * [Compile and debug/How to contribute](https://github.com/alibaba/arthas/blob/master/CONTRIBUTING.md)
* [Release Notes](https://github.com/alibaba/arthas/releases) * [Release Notes](https://github.com/alibaba/arthas/releases)
@ -100,13 +97,13 @@ You can enter its interactive interface by executing `as.sh`, or execute `as.sh
#### Dashboard #### Dashboard
* https://arthas.aliyun.com/doc/en/dashboard * https://arthas.aliyun.com/3.x/doc/en/dashboard
![dashboard](site/docs/.vuepress/public/images/dashboard.png) ![dashboard](site/docs/.vuepress/public/images/dashboard.png)
#### Thread #### Thread
* https://arthas.aliyun.com/doc/en/thread * https://arthas.aliyun.com/3.x/doc/en/thread
See what is eating your CPU (ranked by top CPU usage) and what is going on there in one glance: See what is eating your CPU (ranked by top CPU usage) and what is going on there in one glance:
@ -139,7 +136,7 @@ $ thread -n 3
#### jad #### jad
* https://arthas.aliyun.com/doc/en/jad * https://arthas.aliyun.com/3.x/doc/en/jad
Decompile your class with one shot: Decompile your class with one shot:
@ -179,7 +176,7 @@ public interface Servlet {
``` ```
#### mc #### mc
* https://arthas.aliyun.com/doc/en/mc * https://arthas.aliyun.com/3.x/doc/en/mc
Memory compiler, compiles `.java` files into `.class` files in memory. Memory compiler, compiles `.java` files into `.class` files in memory.
@ -189,7 +186,7 @@ $ mc /tmp/Test.java
#### retransform #### retransform
* https://arthas.aliyun.com/doc/en/retransform * https://arthas.aliyun.com/3.x/doc/en/retransform
Load the external `*.class` files to retransform/hotswap the loaded classes in JVM. Load the external `*.class` files to retransform/hotswap the loaded classes in JVM.
@ -200,7 +197,7 @@ retransform -c 327a647b /tmp/Test.class /tmp/Test\$Inner.class
#### sc #### sc
* https://arthas.aliyun.com/doc/en/sc * https://arthas.aliyun.com/3.x/doc/en/sc
Search any loaded class with detailed information. Search any loaded class with detailed information.
@ -239,7 +236,7 @@ $ sc -d org.springframework.web.context.support.XmlWebApplicationContext
#### vmtool #### vmtool
* https://arthas.aliyun.com/doc/en/vmtool * https://arthas.aliyun.com/3.x/doc/en/vmtool
Get objects in the heap that are instances of the specified class. Get objects in the heap that are instances of the specified class.
@ -261,7 +258,7 @@ $ vmtool --action getInstances --className java.lang.String --limit 10
#### stack #### stack
* https://arthas.aliyun.com/doc/en/stack * https://arthas.aliyun.com/3.x/doc/en/stack
View the call stack of `test.arthas.TestStack#doGet`: View the call stack of `test.arthas.TestStack#doGet`:
@ -298,7 +295,7 @@ ts=2018-09-18 10:11:45;thread_name=http-bio-8080-exec-10;id=d9;is_daemon=true;pr
#### Trace #### Trace
* https://arthas.aliyun.com/doc/en/trace * https://arthas.aliyun.com/3.x/doc/en/trace
See what is slowing down your method invocation with trace command: See what is slowing down your method invocation with trace command:
@ -306,7 +303,7 @@ See what is slowing down your method invocation with trace command:
#### Watch #### Watch
* https://arthas.aliyun.com/doc/en/watch * https://arthas.aliyun.com/3.x/doc/en/watch
Watch the first parameter and thrown exception of `test.arthas.TestWatch#doGet` only if it throws exception. Watch the first parameter and thrown exception of `test.arthas.TestWatch#doGet` only if it throws exception.
@ -322,7 +319,7 @@ ts=2018-09-18 10:26:28;result=@ArrayList[
#### Monitor #### Monitor
* https://arthas.aliyun.com/doc/en/monitor * https://arthas.aliyun.com/3.x/doc/en/monitor
Monitor a specific method invocation statistics, including the total number of invocations, average response time, success rate, and every 5 seconds: Monitor a specific method invocation statistics, including the total number of invocations, average response time, success rate, and every 5 seconds:
@ -345,7 +342,7 @@ Affect(class-cnt:1 , method-cnt:1) cost in 109 ms.
#### Time Tunnel(tt) #### Time Tunnel(tt)
* https://arthas.aliyun.com/doc/en/tt * https://arthas.aliyun.com/3.x/doc/en/tt
Record method invocation data, so that you can check the method invocation parameters, returned value, and thrown exceptions later. It works as if you could come back and replay the past method invocation via time tunnel. Record method invocation data, so that you can check the method invocation parameters, returned value, and thrown exceptions later. It works as if you could come back and replay the past method invocation via time tunnel.
@ -368,7 +365,7 @@ Affect(class-cnt:1 , method-cnt:1) cost in 75 ms.
#### Classloader #### Classloader
* https://arthas.aliyun.com/doc/en/classloader * https://arthas.aliyun.com/3.x/doc/en/classloader
```bash ```bash
$ classloader $ classloader
@ -387,14 +384,14 @@ $ classloader
#### Web Console #### Web Console
* https://arthas.aliyun.com/doc/en/web-console * https://arthas.aliyun.com/3.x/doc/en/web-console
![web console](site/docs/.vuepress/public/images/web-console-local.png) ![web console](site/docs/.vuepress/public/images/web-console-local.png)
#### Profiler/FlameGraph #### Profiler/FlameGraph
* https://arthas.aliyun.com/doc/en/profiler * https://arthas.aliyun.com/3.x/doc/en/profiler
```bash ```bash
$ profiler start $ profiler start
@ -413,7 +410,7 @@ View profiler results under arthas-output via browser:
#### Arthas Spring Boot Starter #### Arthas Spring Boot Starter
* [Arthas Spring Boot Starter](https://arthas.aliyun.com/doc/spring-boot-starter.html) * [Arthas Spring Boot Starter](https://arthas.aliyun.com/3.x/doc/spring-boot-starter.html)
### Known Users ### Known Users

@ -6,7 +6,7 @@
[![Build Status](https://github.com/alibaba/arthas/workflows/JavaCI/badge.svg)](https://github.com/alibaba/arthas/actions) [![Build Status](https://github.com/alibaba/arthas/workflows/JavaCI/badge.svg)](https://github.com/alibaba/arthas/actions)
[![codecov](https://codecov.io/gh/alibaba/arthas/branch/master/graph/badge.svg)](https://codecov.io/gh/alibaba/arthas) [![codecov](https://codecov.io/gh/alibaba/arthas/branch/master/graph/badge.svg)](https://codecov.io/gh/alibaba/arthas)
[![maven](https://img.shields.io/maven-central/v/com.taobao.arthas/arthas-packaging.svg)](https://search.maven.org/search?q=g:com.taobao.arthas) [![maven](https://img.shields.io/maven-central/v/com.taobao.arthas/arthas-packaging?versionPrefix=3)](https://search.maven.org/search?q=g:com.taobao.arthas)
![license](https://img.shields.io/github/license/alibaba/arthas.svg) ![license](https://img.shields.io/github/license/alibaba/arthas.svg)
[![Average time to resolve an issue](http://isitmaintained.com/badge/resolution/alibaba/arthas.svg)](http://isitmaintained.com/project/alibaba/arthas "Average time to resolve an issue") [![Average time to resolve an issue](http://isitmaintained.com/badge/resolution/alibaba/arthas.svg)](http://isitmaintained.com/project/alibaba/arthas "Average time to resolve an issue")
[![Percentage of issues still open](http://isitmaintained.com/badge/open/alibaba/arthas.svg)](http://isitmaintained.com/project/alibaba/arthas "Percentage of issues still open") [![Percentage of issues still open](http://isitmaintained.com/badge/open/alibaba/arthas.svg)](http://isitmaintained.com/project/alibaba/arthas "Percentage of issues still open")
@ -29,73 +29,70 @@ English version goes [here](README.md).
`Arthas`支持JDK 6+支持Linux/Mac/Windows采用命令行交互模式同时提供丰富的 `Tab` 自动补全功能,进一步方便进行问题的定位和诊断。 `Arthas`支持JDK 6+支持Linux/Mac/Windows采用命令行交互模式同时提供丰富的 `Tab` 自动补全功能,进一步方便进行问题的定位和诊断。
### [在线教程(推荐)](https://arthas.aliyun.com/3.x/doc/arthas-tutorials.html?language=cn)
### [在线教程(推荐)](https://arthas.aliyun.com/doc/arthas-tutorials.html?language=cn)
* [使用方法](tutorials/katacoda/README_CN.md#在线教程使用方法)
### 快速开始 ### 快速开始
#### 使用`arthas-boot`(推荐) #### 使用`arthas-boot3`(推荐)
下载`arthas-boot.jar`,然后用`java -jar`的方式启动: 下载`arthas-boot3.jar`,然后用`java -jar`的方式启动:
```bash ```bash
curl -O https://arthas.aliyun.com/arthas-boot.jar curl -O https://arthas.aliyun.com/arthas-boot3.jar
java -jar arthas-boot.jar java -jar arthas-boot3.jar
``` ```
打印帮助信息: 打印帮助信息:
```bash ```bash
java -jar arthas-boot.jar -h java -jar arthas-boot3.jar -h
``` ```
* 如果下载速度比较慢可以使用aliyun的镜像`java -jar arthas-boot.jar --repo-mirror aliyun --use-http` * 如果下载速度比较慢可以使用aliyun的镜像`java -jar arthas-boot3.jar --repo-mirror aliyun --use-http`
#### 使用`as.sh` #### 使用`as3.sh`
Arthas 支持在 Linux/Unix/Mac 等平台上一键安装,请复制以下内容,并粘贴到命令行中,敲 `回车` 执行即可: Arthas 支持在 Linux/Unix/Mac 等平台上一键安装,请复制以下内容,并粘贴到命令行中,敲 `回车` 执行即可:
```bash ```bash
curl -L https://arthas.aliyun.com/install.sh | sh curl -L https://arthas.aliyun.com/install3.sh | sh
``` ```
上述命令会下载启动脚本文件 `as.sh` 到当前目录,你可以放在任何地方或将其加入到 `$PATH` 中。 上述命令会下载启动脚本文件 `as3.sh` 到当前目录,你可以放在任何地方或将其加入到 `$PATH` 中。
直接在shell下面执行`./as.sh`,就会进入交互界面。 直接在shell下面执行`./as3.sh`,就会进入交互界面。
也可以执行`./as.sh -h`来获取更多参数信息。 也可以执行`./as3.sh -h`来获取更多参数信息。
### 文档 ### 文档
* [在线教程(推荐)](https://arthas.aliyun.com/doc/arthas-tutorials.html?language=cn) * [在线教程(推荐)](https://arthas.aliyun.com/3.x/doc/arthas-tutorials.html?language=cn)
* [用户文档](https://arthas.aliyun.com/doc/) * [用户文档](https://arthas.aliyun.com/3.x/doc/)
* [安装](https://arthas.aliyun.com/doc/install-detail.html) * [安装](https://arthas.aliyun.com/3.x/doc/install-detail.html)
* [下载](https://arthas.aliyun.com/doc/download.html) * [下载](https://arthas.aliyun.com/3.x/doc/download.html)
* [快速入门](https://arthas.aliyun.com/doc/quick-start.html) * [快速入门](https://arthas.aliyun.com/3.x/doc/quick-start.html)
* [进阶使用](https://arthas.aliyun.com/doc/advanced-use.html) * [进阶使用](https://arthas.aliyun.com/3.x/doc/advanced-use.html)
* [命令列表](https://arthas.aliyun.com/doc/commands.html) * [命令列表](https://arthas.aliyun.com/3.x/doc/commands.html)
* [WebConsole](https://arthas.aliyun.com/doc/web-console.html) * [WebConsole](https://arthas.aliyun.com/3.x/doc/web-console.html)
* [Docker](https://arthas.aliyun.com/doc/docker.html) * [Docker](https://arthas.aliyun.com/3.x/doc/docker.html)
* [Arthas Spring Boot Starter](https://arthas.aliyun.com/doc/spring-boot-starter.html) * [Arthas Spring Boot Starter](https://arthas.aliyun.com/3.x/doc/spring-boot-starter.html)
* [用户案例](https://github.com/alibaba/arthas/issues?q=label%3Auser-case) * [用户案例](https://github.com/alibaba/arthas/issues?q=label%3Auser-case)
* [FAQ/常见问题](https://arthas.aliyun.com/doc/faq) * [FAQ/常见问题](https://arthas.aliyun.com/3.x/doc/faq)
* [编译调试/参与贡献](https://github.com/alibaba/arthas/blob/master/CONTRIBUTING.md) * [编译调试/参与贡献](https://github.com/alibaba/arthas/blob/master/CONTRIBUTING.md)
* [Release Notes](https://github.com/alibaba/arthas/releases) * [Release Notes](https://github.com/alibaba/arthas/releases)
* [QQ群/钉钉群](https://arthas.aliyun.com/doc/contact-us.html) * [QQ群/钉钉群](https://arthas.aliyun.com/3.x/doc/contact-us.html)
### 案例展示 ### 案例展示
#### Dashboard #### Dashboard
* https://arthas.aliyun.com/doc/dashboard * https://arthas.aliyun.com/3.x/doc/dashboard
![dashboard](site/docs/.vuepress/public/images/dashboard.png) ![dashboard](site/docs/.vuepress/public/images/dashboard.png)
#### Thread #### Thread
* https://arthas.aliyun.com/doc/thread * https://arthas.aliyun.com/3.x/doc/thread
一目了然的了解系统的状态哪些线程比较占cpu他们到底在做什么 一目了然的了解系统的状态哪些线程比较占cpu他们到底在做什么
@ -128,7 +125,7 @@ $ thread -n 3
#### jad #### jad
* https://arthas.aliyun.com/doc/jad * https://arthas.aliyun.com/3.x/doc/jad
对类进行反编译: 对类进行反编译:
@ -168,7 +165,7 @@ public interface Servlet {
``` ```
#### mc #### mc
* https://arthas.aliyun.com/doc/mc * https://arthas.aliyun.com/3.x/doc/mc
Memory Compiler/内存编译器,编译`.java`文件生成`.class`。 Memory Compiler/内存编译器,编译`.java`文件生成`.class`。
@ -177,7 +174,7 @@ mc /tmp/Test.java
``` ```
#### retransform #### retransform
* https://arthas.aliyun.com/doc/retransform * https://arthas.aliyun.com/3.x/doc/retransform
加载外部的`.class`文件retransform 热更新jvm已加载的类。 加载外部的`.class`文件retransform 热更新jvm已加载的类。
@ -187,7 +184,7 @@ retransform -c 327a647b /tmp/Test.class /tmp/Test\$Inner.class
``` ```
#### sc #### sc
* https://arthas.aliyun.com/doc/sc * https://arthas.aliyun.com/3.x/doc/sc
查找JVM中已经加载的类 查找JVM中已经加载的类
@ -225,7 +222,7 @@ $ sc -d org.springframework.web.context.support.XmlWebApplicationContext
#### vmtool #### vmtool
* https://arthas.aliyun.com/doc/vmtool * https://arthas.aliyun.com/3.x/doc/vmtool
从JVM heap中获取指定类的实例。 从JVM heap中获取指定类的实例。
@ -246,7 +243,7 @@ $ vmtool --action getInstances --className java.lang.String --limit 10
``` ```
#### stack #### stack
* https://arthas.aliyun.com/doc/stack * https://arthas.aliyun.com/3.x/doc/stack
查看方法 `test.arthas.TestStack#doGet` 的调用堆栈: 查看方法 `test.arthas.TestStack#doGet` 的调用堆栈:
@ -283,7 +280,7 @@ ts=2018-09-18 10:11:45;thread_name=http-bio-8080-exec-10;id=d9;is_daemon=true;pr
#### Trace #### Trace
* https://arthas.aliyun.com/doc/trace * https://arthas.aliyun.com/3.x/doc/trace
观察方法执行的时候哪个子调用比较慢: 观察方法执行的时候哪个子调用比较慢:
@ -291,7 +288,7 @@ ts=2018-09-18 10:11:45;thread_name=http-bio-8080-exec-10;id=d9;is_daemon=true;pr
#### Watch #### Watch
* https://arthas.aliyun.com/doc/watch * https://arthas.aliyun.com/3.x/doc/watch
观察方法 `test.arthas.TestWatch#doGet` 执行的入参,仅当方法抛出异常时才输出。 观察方法 `test.arthas.TestWatch#doGet` 执行的入参,仅当方法抛出异常时才输出。
@ -307,7 +304,7 @@ ts=2018-09-18 10:26:28;result=@ArrayList[
#### Monitor #### Monitor
* https://arthas.aliyun.com/doc/monitor * https://arthas.aliyun.com/3.x/doc/monitor
监控某个特殊方法的调用统计数据包括总调用次数平均rt成功率等信息每隔5秒输出一次。 监控某个特殊方法的调用统计数据包括总调用次数平均rt成功率等信息每隔5秒输出一次。
@ -331,7 +328,7 @@ Affect(class-cnt:1 , method-cnt:1) cost in 109 ms.
#### Time Tunnel(tt) #### Time Tunnel(tt)
* https://arthas.aliyun.com/doc/tt * https://arthas.aliyun.com/3.x/doc/tt
记录方法调用信息,支持事后查看方法调用的参数,返回值,抛出的异常等信息,仿佛穿越时空隧道回到调用现场一般。 记录方法调用信息,支持事后查看方法调用的参数,返回值,抛出的异常等信息,仿佛穿越时空隧道回到调用现场一般。
@ -354,7 +351,7 @@ Affect(class-cnt:1 , method-cnt:1) cost in 75 ms.
#### Classloader #### Classloader
* https://arthas.aliyun.com/doc/classloader * https://arthas.aliyun.com/3.x/doc/classloader
了解当前系统中有多少类加载器,以及每个加载器加载的类数量,帮助您判断是否有类加载器泄露。 了解当前系统中有多少类加载器,以及每个加载器加载的类数量,帮助您判断是否有类加载器泄露。
@ -375,13 +372,13 @@ $ classloader
#### Web Console #### Web Console
* https://arthas.aliyun.com/doc/web-console * https://arthas.aliyun.com/3.x/doc/web-console
![web console](site/docs/.vuepress/public/images/web-console-local.png) ![web console](site/docs/.vuepress/public/images/web-console-local.png)
#### Profiler/FlameGraph/火焰图 #### Profiler/FlameGraph/火焰图
* https://arthas.aliyun.com/doc/profiler * https://arthas.aliyun.com/3.x/doc/profiler
```bash ```bash
$ profiler start $ profiler start
@ -400,7 +397,7 @@ OK
#### Arthas Spring Boot Starter #### Arthas Spring Boot Starter
* [Arthas Spring Boot Starter](https://arthas.aliyun.com/doc/spring-boot-starter.html) * [Arthas Spring Boot Starter](https://arthas.aliyun.com/3.x/doc/spring-boot-starter.html)
### Known Users ### Known Users

@ -59,7 +59,7 @@ public class ArthasAgent {
} }
/** /**
* @see https://arthas.aliyun.com/doc/arthas-properties.html * @see https://arthas.aliyun.com/3.x/doc/arthas-properties.html
* @param configMap * @param configMap
*/ */
public static void attach(Map<String, String> configMap) { public static void attach(Map<String, String> configMap) {

@ -1,6 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# WIKI: https://arthas.aliyun.com/doc # WIKI: https://arthas.aliyun.com/3.x/doc
# This script only supports bash, do not support posix sh. # This script only supports bash, do not support posix sh.
# If you have the problem like Syntax error: "(" unexpected (expecting "fi"), # If you have the problem like Syntax error: "(" unexpected (expecting "fi"),
# Try to run "bash -version" to check the version. # Try to run "bash -version" to check the version.
@ -188,23 +188,23 @@ esac
# check curl/grep/awk/telnet/unzip command # check curl/grep/awk/telnet/unzip command
if ! [ -x "$(command -v curl)" ]; then if ! [ -x "$(command -v curl)" ]; then
echo 'Error: curl is not installed. Try to use java -jar arthas-boot.jar' >&2 echo 'Error: curl is not installed. Try to use java -jar arthas-boot3.jar' >&2
exit 1 exit 1
fi fi
if ! [ -x "$(command -v grep)" ]; then if ! [ -x "$(command -v grep)" ]; then
echo 'Error: grep is not installed. Try to use java -jar arthas-boot.jar' >&2 echo 'Error: grep is not installed. Try to use java -jar arthas-boot3.jar' >&2
exit 1 exit 1
fi fi
if ! [ -x "$(command -v awk)" ]; then if ! [ -x "$(command -v awk)" ]; then
echo 'Error: awk is not installed. Try to use java -jar arthas-boot.jar' >&2 echo 'Error: awk is not installed. Try to use java -jar arthas-boot3.jar' >&2
exit 1 exit 1
fi fi
if ! [ -x "$(command -v telnet)" ]; then if ! [ -x "$(command -v telnet)" ]; then
echo 'Error: telnet is not installed. Try to use java -jar arthas-boot.jar' >&2 echo 'Error: telnet is not installed. Try to use java -jar arthas-boot3.jar' >&2
exit 1 exit 1
fi fi
if ! [ -x "$(command -v unzip)" ]; then if ! [ -x "$(command -v unzip)" ]; then
echo 'Error: unzip is not installed. Try to use java -jar arthas-boot.jar' >&2 echo 'Error: unzip is not installed. Try to use java -jar arthas-boot3.jar' >&2
exit 1 exit 1
fi fi
@ -319,10 +319,10 @@ reset_for_env()
} }
# get latest version from local # get latest 3.x version from local
get_local_version() get_local_3x_version()
{ {
ls "${ARTHAS_LIB_DIR}" | sort | tail -1 ls "${ARTHAS_LIB_DIR}" | grep -oE '3\.[0-9]+\.[0-9]+.*' | sort -V | tail -1 | tr -d '\r\n'
} }
get_repo_url() get_repo_url()
@ -334,10 +334,10 @@ get_repo_url()
echo "${repoUrl}" echo "${repoUrl}"
} }
# get latest version from remote # get latest 3.x version from remote
get_remote_version() get_remote_3x_version()
{ {
curl -sLk "https://arthas.aliyun.com/api/latest_version" curl -sLk "https://arthas.aliyun.com/api/versions" | grep -oE '3\.[0-9]+\.[0-9]+.*' | sort -V | tail -1 | tr -d '\r\n'
} }
# check version greater # check version greater
@ -466,22 +466,22 @@ Options and Arguments:
<pid> Target pid <pid> Target pid
EXAMPLES: EXAMPLES:
./as.sh <pid> ./as3.sh <pid>
./as.sh --telnet-port 9999 --http-port -1 ./as3.sh --telnet-port 9999 --http-port -1
./as.sh --username admin --password <password> ./as3.sh --username admin --password <password>
./as.sh --tunnel-server 'ws://192.168.10.11:7777/ws' --app-name demoapp ./as3.sh --tunnel-server 'ws://192.168.10.11:7777/ws' --app-name demoapp
./as.sh --tunnel-server 'ws://192.168.10.11:7777/ws' --agent-id bvDOe8XbTM2pQWjF4cfw ./as3.sh --tunnel-server 'ws://192.168.10.11:7777/ws' --agent-id bvDOe8XbTM2pQWjF4cfw
./as.sh --stat-url 'http://192.168.10.11:8080/api/stat' ./as3.sh --stat-url 'http://192.168.10.11:8080/api/stat'
./as.sh -c 'sysprop; thread' <pid> ./as3.sh -c 'sysprop; thread' <pid>
./as.sh -f batch.as <pid> ./as3.sh -f batch.as <pid>
./as.sh --use-version 3.7.2 ./as3.sh --use-version 3.7.2
./as.sh --session-timeout 3600 ./as3.sh --session-timeout 3600
./as.sh --attach-only ./as3.sh --attach-only
./as.sh --disabled-commands stop,dump ./as3.sh --disabled-commands stop,dump
./as.sh --select math-game ./as3.sh --select math-game
./as.sh --repo-mirror aliyun --use-http ./as3.sh --repo-mirror aliyun --use-http
WIKI: WIKI:
https://arthas.aliyun.com/doc https://arthas.aliyun.com/3.x/doc
Here is the list of possible java process(es) to attatch: Here is the list of possible java process(es) to attatch:
" "
@ -812,8 +812,8 @@ parse_arguments()
fi fi
if [[ ($httpPortPid) && ($TARGET_PID != $httpPortPid) ]]; then if [[ ($httpPortPid) && ($TARGET_PID != $httpPortPid) ]]; then
echo "Target process $TARGET_PID is not the process using port $(getHttpPortOrDefault), you will connect to an unexpected process." echo "Target process $TARGET_PID is not the process using port $(getHttpPortOrDefault), you will connect to an unexpected process."
echo "1. Try to restart as.sh, select process $httpPortPid, shutdown it first with running the 'stop' command." echo "1. Try to restart as3.sh, select process $httpPortPid, shutdown it first with running the 'stop' command."
echo "2. Try to use different http port, for example: as.sh --telnet-port 9998 --http-port 9999" echo "2. Try to use different http port, for example: as3.sh --telnet-port 9998 --http-port 9999"
exit 1 exit 1
fi fi
elif [ -z ${TARGET_PID} ]; then elif [ -z ${TARGET_PID} ]; then
@ -931,8 +931,8 @@ sanity_check() {
if [ "$current_user" != "$target_user" ]; then if [ "$current_user" != "$target_user" ]; then
echo "The current user ($current_user) does not match with the owner of process ${TARGET_PID} ($target_user)." echo "The current user ($current_user) does not match with the owner of process ${TARGET_PID} ($target_user)."
echo "To solve this, choose one of the following command:" echo "To solve this, choose one of the following command:"
echo " 1) sudo su $target_user && ./as.sh" echo " 1) sudo su $target_user && ./as3.sh"
echo " 2) sudo -u $target_user -EH ./as.sh" echo " 2) sudo -u $target_user -EH ./as3.sh"
exit_on_err 1 exit_on_err 1
fi fi
} }
@ -972,15 +972,15 @@ port_pid_check() {
print_telnet_port_pid_error() { print_telnet_port_pid_error() {
echo "[ERROR] The telnet port $(getTelnetPortOrDefault) is used by process $telnetPortPid instead of target process $TARGET_PID, you will connect to an unexpected process." echo "[ERROR] The telnet port $(getTelnetPortOrDefault) is used by process $telnetPortPid instead of target process $TARGET_PID, you will connect to an unexpected process."
echo "[ERROR] 1. Try to restart as.sh, select process $telnetPortPid, shutdown it first with running the 'stop' command." echo "[ERROR] 1. Try to restart as3.sh, select process $telnetPortPid, shutdown it first with running the 'stop' command."
echo "[ERROR] 2. Try to stop the existing arthas instance: java -jar arthas-client.jar 127.0.0.1 $(getTelnetPortOrDefault) -c \"stop\"" echo "[ERROR] 2. Try to stop the existing arthas instance: java -jar arthas-client.jar 127.0.0.1 $(getTelnetPortOrDefault) -c \"stop\""
echo "[ERROR] 3. Try to use different telnet port, for example: as.sh --telnet-port 9998 --http-port -1" echo "[ERROR] 3. Try to use different telnet port, for example: as3.sh --telnet-port 9998 --http-port -1"
} }
print_telnet_port_used_error() { print_telnet_port_used_error() {
local error_msg=$1 local error_msg=$1
echo "[ERROR] The telnet port $(getTelnetPortOrDefault) is used, but process $error_msg, you will connect to an unexpected process." echo "[ERROR] The telnet port $(getTelnetPortOrDefault) is used, but process $error_msg, you will connect to an unexpected process."
echo "[ERROR] Try to use different telnet port, for example: as.sh --telnet-port 9998 --http-port -1" echo "[ERROR] Try to use different telnet port, for example: as3.sh --telnet-port 9998 --http-port -1"
} }
# active console # active console
@ -1051,13 +1051,17 @@ main()
# try to find arthas home from --use-version # try to find arthas home from --use-version
if [[ (-z "${ARTHAS_HOME}") && (! -z "${USE_VERSION}") ]]; then if [[ (-z "${ARTHAS_HOME}") && (! -z "${USE_VERSION}") ]]; then
if [[ "${USE_VERSION:0:1}" != "3" ]] ; then
echo "Arthas version ${USE_VERSION} is not supported; only version 3.x is supported." 1>&2
exit 1
fi
if [[ ! -d "${ARTHAS_LIB_DIR}/${USE_VERSION}/arthas" ]] ; then if [[ ! -d "${ARTHAS_LIB_DIR}/${USE_VERSION}/arthas" ]] ; then
update_if_necessary "${USE_VERSION}" || echo "update fail, ignore this update." 1>&2 update_if_necessary "${USE_VERSION}" || echo "update fail, ignore this update." 1>&2
fi fi
ARTHAS_HOME="${ARTHAS_LIB_DIR}/${USE_VERSION}/arthas" ARTHAS_HOME="${ARTHAS_LIB_DIR}/${USE_VERSION}/arthas"
fi fi
# try to set arthas home from as.sh directory # try to set arthas home from as3.sh directory
if [ -z "${ARTHAS_HOME}" ] ; then if [ -z "${ARTHAS_HOME}" ] ; then
[[ -a "${DIR}/arthas-core.jar" ]] \ [[ -a "${DIR}/arthas-core.jar" ]] \
&& [[ -a "${DIR}/arthas-agent.jar" ]] \ && [[ -a "${DIR}/arthas-agent.jar" ]] \
@ -1067,13 +1071,13 @@ main()
# try to find arthas under ~/.arthas/lib # try to find arthas under ~/.arthas/lib
if [ -z "${ARTHAS_HOME}" ] ; then if [ -z "${ARTHAS_HOME}" ] ; then
local remote_version=$(get_remote_version) local remote_3x_version=$(get_remote_3x_version)
local arthas_local_version=$(get_local_version) local arthas_local_3x_version=$(get_local_3x_version)
if $(version_gt $remote_version $arthas_local_version) ; then if $(version_gt $remote_3x_version $arthas_local_3x_version) ; then
update_if_necessary "${remote_version}" || echo "update fail, ignore this update." 1>&2 update_if_necessary "${remote_3x_version}" || echo "update fail, ignore this update." 1>&2
fi fi
local arthas_local_version=$(get_local_version) local arthas_local_3x_version=$(get_local_3x_version)
ARTHAS_HOME="${ARTHAS_LIB_DIR}/${arthas_local_version}/arthas" ARTHAS_HOME="${ARTHAS_LIB_DIR}/${arthas_local_3x_version}/arthas"
fi fi
echo "Arthas home: ${ARTHAS_HOME}" echo "Arthas home: ${ARTHAS_HOME}"

@ -26,7 +26,7 @@ if [[ ! -x ${ARTHAS_LIB_HOME} ]]; then
cp *.jar ${ARTHAS_LIB_HOME}/ cp *.jar ${ARTHAS_LIB_HOME}/
# make it -x # make it -x
chmod +x ./as.sh chmod +x ./as3.sh
fi fi

@ -1,16 +1,16 @@
#! /bin/bash #! /bin/bash
# temp file of as.sh # temp file of as3.sh
TEMP_ARTHAS_FILE="./as.sh.$$" TEMP_ARTHAS_FILE="./as3.sh.$$"
# target file of as.sh # target file of as3.sh
TARGET_ARTHAS_FILE="./as.sh" TARGET_ARTHAS_FILE="./as3.sh"
# update timeout(sec) # update timeout(sec)
SO_TIMEOUT=60 SO_TIMEOUT=60
# default downloading url # default downloading url
ARTHAS_FILE_URL="https://arthas.aliyun.com/as.sh" ARTHAS_FILE_URL="https://arthas.aliyun.com/as3.sh"
# exit shell with err_code # exit shell with err_code
# $1 : err_code # $1 : err_code
@ -40,7 +40,7 @@ curl \
|| exit_on_err 1 "download failed!" || exit_on_err 1 "download failed!"
# write or overwrite local file # write or overwrite local file
rm -rf as.sh rm -rf as3.sh
mv ${TEMP_ARTHAS_FILE} ${TARGET_ARTHAS_FILE} mv ${TEMP_ARTHAS_FILE} ${TARGET_ARTHAS_FILE}
chmod +x ${TARGET_ARTHAS_FILE} chmod +x ${TARGET_ARTHAS_FILE}

@ -7,8 +7,8 @@
<version>${revision}</version> <version>${revision}</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<artifactId>arthas-boot</artifactId> <artifactId>arthas-boot3</artifactId>
<name>arthas-boot</name> <name>arthas-boot3</name>
<url>https://github.com/alibaba/arthas</url> <url>https://github.com/alibaba/arthas</url>
<dependencies> <dependencies>
@ -29,7 +29,7 @@
</dependencies> </dependencies>
<build> <build>
<finalName>arthas-boot</finalName> <finalName>arthas-boot3</finalName>
<plugins> <plugins>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>

@ -45,21 +45,21 @@ import com.taobao.middleware.cli.annotations.Summary;
*/ */
@Name("arthas-boot") @Name("arthas-boot")
@Summary("Bootstrap Arthas") @Summary("Bootstrap Arthas")
@Description("EXAMPLES:\n" + " java -jar arthas-boot.jar <pid>\n" @Description("EXAMPLES:\n" + " java -jar arthas-boot3.jar <pid>\n"
+ " java -jar arthas-boot.jar --telnet-port 9999 --http-port -1\n" + " java -jar arthas-boot3.jar --telnet-port 9999 --http-port -1\n"
+ " java -jar arthas-boot.jar --username admin --password <password>\n" + " java -jar arthas-boot3.jar --username admin --password <password>\n"
+ " java -jar arthas-boot.jar --tunnel-server 'ws://192.168.10.11:7777/ws' --app-name demoapp\n" + " java -jar arthas-boot3.jar --tunnel-server 'ws://192.168.10.11:7777/ws' --app-name demoapp\n"
+ " java -jar arthas-boot.jar --tunnel-server 'ws://192.168.10.11:7777/ws' --agent-id bvDOe8XbTM2pQWjF4cfw\n" + " java -jar arthas-boot3.jar --tunnel-server 'ws://192.168.10.11:7777/ws' --agent-id bvDOe8XbTM2pQWjF4cfw\n"
+ " java -jar arthas-boot.jar --stat-url 'http://192.168.10.11:8080/api/stat'\n" + " java -jar arthas-boot3.jar --stat-url 'http://192.168.10.11:8080/api/stat'\n"
+ " java -jar arthas-boot.jar -c 'sysprop; thread' <pid>\n" + " java -jar arthas-boot3.jar -c 'sysprop; thread' <pid>\n"
+ " java -jar arthas-boot.jar -f batch.as <pid>\n" + " java -jar arthas-boot3.jar -f batch.as <pid>\n"
+ " java -jar arthas-boot.jar --use-version 3.7.2\n" + " java -jar arthas-boot3.jar --use-version 3.7.2\n"
+ " java -jar arthas-boot.jar --versions\n" + " java -jar arthas-boot3.jar --versions\n"
+ " java -jar arthas-boot.jar --select math-game\n" + " java -jar arthas-boot3.jar --select math-game\n"
+ " java -jar arthas-boot.jar --session-timeout 3600\n" + " java -jar arthas-boot.jar --attach-only\n" + " java -jar arthas-boot3.jar --session-timeout 3600\n" + " java -jar arthas-boot3.jar --attach-only\n"
+ " java -jar arthas-boot.jar --disabled-commands stop,dump\n" + " java -jar arthas-boot3.jar --disabled-commands stop,dump\n"
+ " java -jar arthas-boot.jar --repo-mirror aliyun --use-http\n" + "WIKI:\n" + " java -jar arthas-boot3.jar --repo-mirror aliyun --use-http\n" + "WIKI:\n"
+ " https://arthas.aliyun.com/doc\n") + " https://arthas.aliyun.com/3.x/doc\n")
public class Bootstrap { public class Bootstrap {
private static final int DEFAULT_TELNET_PORT = 3658; private static final int DEFAULT_TELNET_PORT = 3658;
private static final int DEFAULT_HTTP_PORT = 8563; private static final int DEFAULT_HTTP_PORT = 8563;
@ -86,7 +86,7 @@ public class Bootstrap {
* <pre> * <pre>
* The directory contains arthas-core.jar/arthas-client.jar/arthas-spy.jar. * The directory contains arthas-core.jar/arthas-client.jar/arthas-spy.jar.
* 1. When use-version is not empty, try to find arthas home under ~/.arthas/lib * 1. When use-version is not empty, try to find arthas home under ~/.arthas/lib
* 2. Try set the directory where arthas-boot.jar is located to arthas home * 2. Try set the directory where arthas-boot3.jar is located to arthas home
* 3. Try to download from remote repo * 3. Try to download from remote repo
* </pre> * </pre>
*/ */
@ -412,7 +412,7 @@ public class Bootstrap {
pid, bootstrap.getHttpPortOrDefault()); pid, bootstrap.getHttpPortOrDefault());
AnsiLog.error("1. Try to restart arthas-boot, select process {}, shutdown it first with running the 'stop' command.", AnsiLog.error("1. Try to restart arthas-boot, select process {}, shutdown it first with running the 'stop' command.",
httpPortPid); httpPortPid);
AnsiLog.error("2. Or try to use different http port, for example: java -jar arthas-boot.jar --telnet-port 9998 --http-port 9999"); AnsiLog.error("2. Or try to use different http port, for example: java -jar arthas-boot3.jar --telnet-port 9998 --http-port 9999");
System.exit(1); System.exit(1);
} }
@ -423,6 +423,11 @@ public class Bootstrap {
arthasHomeDir = new File(bootstrap.getArthasHome()); arthasHomeDir = new File(bootstrap.getArthasHome());
} }
if (arthasHomeDir == null && bootstrap.getUseVersion() != null) { if (arthasHomeDir == null && bootstrap.getUseVersion() != null) {
// exit when useVersion is not 3.x
if (!bootstrap.getUseVersion().startsWith("3")) {
AnsiLog.error("Arthas version {} is not supported; only version 3.x is supported.", bootstrap.getUseVersion());
System.exit(1);
}
// try to find from ~/.arthas/lib // try to find from ~/.arthas/lib
File specialVersionDir = new File(System.getProperty("user.home"), ".arthas" + File.separator + "lib" File specialVersionDir = new File(System.getProperty("user.home"), ".arthas" + File.separator + "lib"
+ File.separator + bootstrap.getUseVersion() + File.separator + "arthas"); + File.separator + bootstrap.getUseVersion() + File.separator + "arthas");
@ -435,7 +440,7 @@ public class Bootstrap {
arthasHomeDir = specialVersionDir; arthasHomeDir = specialVersionDir;
} }
// Try set the directory where arthas-boot.jar is located to arhtas home // Try set the directory where arthas-boot3.jar is located to arthas home
if (arthasHomeDir == null) { if (arthasHomeDir == null) {
CodeSource codeSource = Bootstrap.class.getProtectionDomain().getCodeSource(); CodeSource codeSource = Bootstrap.class.getProtectionDomain().getCodeSource();
if (codeSource != null) { if (codeSource != null) {
@ -461,24 +466,25 @@ public class Bootstrap {
/** /**
* <pre> * <pre>
* 1. get local latest version * 1. get local latest 3.x version
* 2. get remote latest version * 2. get remote latest 3.x version
* 3. compare two version * 3. compare two version
* </pre> * </pre>
*/ */
List<String> versionList = listNames(ARTHAS_LIB_DIR); List<String> versionList = listNames(ARTHAS_LIB_DIR);
Collections.sort(versionList);
String localLastestVersion = null; String localLatest3xVersion = null;
if (!versionList.isEmpty()) { for (String version : versionList) {
localLastestVersion = versionList.get(versionList.size() - 1); if (version.startsWith("3") && (localLatest3xVersion == null || version.compareTo(localLatest3xVersion) > 0)) {
localLatest3xVersion = version;
}
} }
String remoteLastestVersion = DownloadUtils.readLatestReleaseVersion(); String remoteLatest3xVersion = DownloadUtils.readLatest3xReleaseVersion();
boolean needDownload = false; boolean needDownload = false;
if (localLastestVersion == null) { if (localLatest3xVersion == null) {
if (remoteLastestVersion == null) { if (remoteLatest3xVersion == null) {
// exit // exit
AnsiLog.error("Can not find Arthas under local: {} and remote repo mirror: {}", ARTHAS_LIB_DIR, AnsiLog.error("Can not find Arthas under local: {} and remote repo mirror: {}", ARTHAS_LIB_DIR,
bootstrap.getRepoMirror()); bootstrap.getRepoMirror());
@ -489,10 +495,10 @@ public class Bootstrap {
needDownload = true; needDownload = true;
} }
} else { } else {
if (remoteLastestVersion != null) { if (remoteLatest3xVersion != null) {
if (localLastestVersion.compareTo(remoteLastestVersion) < 0) { if (localLatest3xVersion.compareTo(remoteLatest3xVersion) < 0) {
AnsiLog.info("local lastest version: {}, remote lastest version: {}, try to download from remote.", AnsiLog.info("local latest 3.x version: {}, remote latest 3.x version: {}, try to download from remote.",
localLastestVersion, remoteLastestVersion); localLatest3xVersion, remoteLatest3xVersion);
needDownload = true; needDownload = true;
} }
} }
@ -500,12 +506,12 @@ public class Bootstrap {
if (needDownload) { if (needDownload) {
// try to download arthas from remote server. // try to download arthas from remote server.
DownloadUtils.downArthasPackaging(bootstrap.getRepoMirror(), bootstrap.isuseHttp(), DownloadUtils.downArthasPackaging(bootstrap.getRepoMirror(), bootstrap.isuseHttp(),
remoteLastestVersion, ARTHAS_LIB_DIR.getAbsolutePath()); remoteLatest3xVersion, ARTHAS_LIB_DIR.getAbsolutePath());
localLastestVersion = remoteLastestVersion; localLatest3xVersion = remoteLatest3xVersion;
} }
// get the latest version // get the latest 3.x version
arthasHomeDir = new File(ARTHAS_LIB_DIR, localLastestVersion + File.separator + "arthas"); arthasHomeDir = new File(ARTHAS_LIB_DIR, localLatest3xVersion + File.separator + "arthas");
} }
verifyArthasHome(arthasHomeDir.getAbsolutePath()); verifyArthasHome(arthasHomeDir.getAbsolutePath());
@ -640,7 +646,7 @@ public class Bootstrap {
AnsiLog.error("1. Try to restart arthas-boot, select process {}, shutdown it first with running the 'stop' command.", AnsiLog.error("1. Try to restart arthas-boot, select process {}, shutdown it first with running the 'stop' command.",
telnetPortPid); telnetPortPid);
AnsiLog.error("2. Or try to stop the existing arthas instance: java -jar arthas-client.jar 127.0.0.1 {} -c \"stop\"", bootstrap.getTelnetPortOrDefault()); AnsiLog.error("2. Or try to stop the existing arthas instance: java -jar arthas-client.jar 127.0.0.1 {} -c \"stop\"", bootstrap.getTelnetPortOrDefault());
AnsiLog.error("3. Or try to use different telnet port, for example: java -jar arthas-boot.jar --telnet-port 9998 --http-port -1"); AnsiLog.error("3. Or try to use different telnet port, for example: java -jar arthas-boot3.jar --telnet-port 9998 --http-port -1");
System.exit(1); System.exit(1);
} }
} }
@ -671,7 +677,7 @@ public class Bootstrap {
} }
if (error != null) { if (error != null) {
AnsiLog.error("The telnet port {} is used, but process {}, you will connect to an unexpected process.", telnetPort, error); AnsiLog.error("The telnet port {} is used, but process {}, you will connect to an unexpected process.", telnetPort, error);
AnsiLog.error("Try to use a different telnet port, for example: java -jar arthas-boot.jar --telnet-port 9998 --http-port -1"); AnsiLog.error("Try to use a different telnet port, for example: java -jar arthas-boot3.jar --telnet-port 9998 --http-port -1");
System.exit(1); System.exit(1);
} }

@ -44,6 +44,19 @@ public class DownloadUtils {
return null; return null;
} }
public static String readLatest3xReleaseVersion() {
List<String> versions = readRemoteVersions();
String latest3xReleaseVersion = null;
if (versions != null) {
for (String version : versions) {
if (version.startsWith("3") && (latest3xReleaseVersion == null || version.compareTo(latest3xReleaseVersion) > 0)) {
latest3xReleaseVersion = version;
}
}
}
return latest3xReleaseVersion;
}
public static List<String> readRemoteVersions() { public static List<String> readRemoteVersions() {
InputStream inputStream = null; InputStream inputStream = null;
try { try {

@ -220,7 +220,7 @@ public class ProcessUtils {
} }
throw new IllegalArgumentException("Can not find tools.jar under java home: " + javaHome throw new IllegalArgumentException("Can not find tools.jar under java home: " + javaHome
+ ", please try to start arthas-boot with full path java. Such as /opt/jdk/bin/java -jar arthas-boot.jar"); + ", please try to start arthas-boot3 with full path java. Such as /opt/jdk/bin/java -jar arthas-boot3.jar");
} }
} else { } else {
FOUND_JAVA_HOME = javaHome; FOUND_JAVA_HOME = javaHome;

@ -8,7 +8,7 @@ arthas.sessionTimeout=1800
#arthas.enhanceLoaders=java.lang.ClassLoader #arthas.enhanceLoaders=java.lang.ClassLoader
# https://arthas.aliyun.com/doc/en/auth # https://arthas.aliyun.com/3.x/doc/en/auth
# arthas.username=arthas # arthas.username=arthas
# arthas.password=arthas # arthas.password=arthas

@ -25,7 +25,7 @@ public interface Constants {
String WIKI = "\nWIKI:\n"; String WIKI = "\nWIKI:\n";
String WIKI_HOME = " https://arthas.aliyun.com/doc/"; String WIKI_HOME = " https://arthas.aliyun.com/3.x/doc/";
String EXPRESS_EXAMPLES = "Examples:\n" + String EXPRESS_EXAMPLES = "Examples:\n" +
" params\n" + " params\n" +

@ -28,8 +28,8 @@ public class ArthasBanner {
private static final String LOGO_LOCATION = "/com/taobao/arthas/core/res/logo.txt"; private static final String LOGO_LOCATION = "/com/taobao/arthas/core/res/logo.txt";
private static final String CREDIT_LOCATION = "/com/taobao/arthas/core/res/thanks.txt"; private static final String CREDIT_LOCATION = "/com/taobao/arthas/core/res/thanks.txt";
private static final String VERSION_LOCATION = "/com/taobao/arthas/core/res/version"; private static final String VERSION_LOCATION = "/com/taobao/arthas/core/res/version";
private static final String WIKI = "https://arthas.aliyun.com/doc"; private static final String WIKI = "https://arthas.aliyun.com/3.x/doc";
private static final String TUTORIALS = "https://arthas.aliyun.com/doc/arthas-tutorials.html"; private static final String TUTORIALS = "https://arthas.aliyun.com/3.x/doc/arthas-tutorials.html";
private static final String ARTHAS_LATEST_VERSIONS_URL = "https://arthas.aliyun.com/api/latest_version"; private static final String ARTHAS_LATEST_VERSIONS_URL = "https://arthas.aliyun.com/api/latest_version";
private static final int CONNECTION_TIMEOUT = 1000; private static final int CONNECTION_TIMEOUT = 1000;

@ -1 +0,0 @@
scenario_root : tutorials/katacoda

@ -110,7 +110,7 @@
</data> </data>
<data> <data>
<src>${project.build.directory}/arthas-bin/as.sh </src> <src>${project.build.directory}/arthas-bin/as3.sh </src>
<type>file</type> <type>file</type>
<mapper> <mapper>
<type>perm</type> <type>perm</type>
@ -206,7 +206,7 @@
<groupname>root</groupname> <groupname>root</groupname>
<sources> <sources>
<softlinkSource> <softlinkSource>
<location>/usr/share/arthas/as.sh</location> <location>/usr/share/arthas/as3.sh</location>
</softlinkSource> </softlinkSource>
</sources> </sources>
</mapping> </mapping>

@ -34,8 +34,8 @@
<destName>arthas-client.jar</destName> <destName>arthas-client.jar</destName>
</file> </file>
<file> <file>
<source>../boot/target/arthas-boot-jar-with-dependencies.jar</source> <source>../boot/target/arthas-boot3-jar-with-dependencies.jar</source>
<destName>arthas-boot.jar</destName> <destName>arthas-boot3.jar</destName>
</file> </file>
<file> <file>
<source>../math-game/target/math-game.jar</source> <source>../math-game/target/math-game.jar</source>
@ -43,12 +43,12 @@
</file> </file>
<file> <file>
<source>../bin/install-local.sh</source> <source>../bin/install-local3.sh</source>
<fileMode>0755</fileMode> <fileMode>0755</fileMode>
<filtered>true</filtered> <filtered>true</filtered>
</file> </file>
<file> <file>
<source>../bin/as.sh </source> <source>../bin/as3.sh </source>
<fileMode>0755</fileMode> <fileMode>0755</fileMode>
</file> </file>
<file> <file>

@ -12,6 +12,7 @@ export default defineUserConfig({
title: "arthas", title: "arthas",
description: "arthas user document", description: "arthas user document",
head, head,
base: "/3.x/",
locales: { locales: {
"/": { "/": {
lang: "zh-CN", lang: "zh-CN",

@ -20,4 +20,13 @@ export const navbarEN = [
text: "DOWNLOAD", text: "DOWNLOAD",
link: "/en/doc/download.md", link: "/en/doc/download.md",
}, },
{
text: "VERSIONS",
children: [
{
text: "v4.x",
link: "https://arthas.aliyun.com/en/",
},
],
},
]; ];

@ -20,4 +20,13 @@ export const navbarZH = [
text: "下载", text: "下载",
link: "/doc/download.md", link: "/doc/download.md",
}, },
{
text: "版本",
children: [
{
text: "v4.x",
link: "https://arthas.aliyun.com/",
},
],
},
]; ];

@ -41,7 +41,7 @@
<script> <script>
if (window.location.href.startsWith("https://alibaba.github.io/arthas/")) { if (window.location.href.startsWith("https://alibaba.github.io/arthas/")) {
window.location.href = window.location.href =
"https://arthas.aliyun.com/doc/" + "https://arthas.aliyun.com/3.x/doc/" +
window.location.href.substr("https://alibaba.github.io/arthas/".length); window.location.href.substr("https://alibaba.github.io/arthas/".length);
} }
</script> </script>
@ -1103,9 +1103,9 @@
}, },
docUrl: function () { docUrl: function () {
if (this.language === "en") { if (this.language === "en") {
return "https://arthas.aliyun.com/doc/en"; return "https://arthas.aliyun.com/3.x/doc/en";
} else { } else {
return "https://arthas.aliyun.com/doc"; return "https://arthas.aliyun.com/3.x/doc";
} }
}, },
tutorialsStr: function () { tutorialsStr: function () {

@ -69,11 +69,11 @@ Http API 提供结构化的数据,支持更复杂的交互功能,方便自
- [批处理功能](batch-support.md) - [批处理功能](batch-support.md)
## as.sh 和 arthas-boot 技巧 ## as3.sh 和 arthas-boot3 技巧
- 通过`select`功能选择 attach 的进程。 - 通过`select`功能选择 attach 的进程。
正常情况下,每次执行`as.sh`/`arthas-boot.jar`需要选择,或者指定 PID。这样会比较麻烦因为每次启动应用它的 PID 会变化。 正常情况下,每次执行`as3.sh`/`arthas-boot3.jar`需要选择,或者指定 PID。这样会比较麻烦因为每次启动应用它的 PID 会变化。
比如,已经启动了`math-game.jar`,使用`jps`命令查看: 比如,已经启动了`math-game.jar`,使用`jps`命令查看:
@ -86,7 +86,7 @@ $ jps
通过`select`参数可以指定进程名字,非常方便。 通过`select`参数可以指定进程名字,非常方便。
```bash ```bash
$ ./as.sh --select math-game $ ./as3.sh --select math-game
Arthas script version: 3.3.6 Arthas script version: 3.3.6
[INFO] JAVA_HOME: /tmp/java/8.0.222-zulu [INFO] JAVA_HOME: /tmp/java/8.0.222-zulu
Arthas home: /Users/admin/.arthas/lib/3.3.6/arthas Arthas home: /Users/admin/.arthas/lib/3.3.6/arthas
@ -108,8 +108,8 @@ Escape character is '^]'.
`--' `--'`--' '--' `--' `--' `--'`--' `--'`-----' `--' `--'`--' '--' `--' `--' `--'`--' `--'`-----'
wiki https://arthas.aliyun.com/doc wiki https://arthas.aliyun.com/3.x/doc
tutorials https://arthas.aliyun.com/doc/arthas-tutorials.html tutorials https://arthas.aliyun.com/3.x/doc/arthas-tutorials.html
version 3.3.6 version 3.3.6
pid 58883 pid 58883
``` ```
@ -118,7 +118,7 @@ pid 58883
在`3.1.4`版本后,增加了用户数据回报功能,方便统一做安全或者历史数据统计。 在`3.1.4`版本后,增加了用户数据回报功能,方便统一做安全或者历史数据统计。
在启动时,指定`stat-url`,就会回报执行的每一行命令,比如: `./as.sh --stat-url 'http://192.168.10.11:8080/api/stat'` 在启动时,指定`stat-url`,就会回报执行的每一行命令,比如: `./as3.sh --stat-url 'http://192.168.10.11:8080/api/stat'`
在 tunnel server 里有一个示例的回报代码,用户可以自己在服务器上实现。 在 tunnel server 里有一个示例的回报代码,用户可以自己在服务器上实现。

@ -56,7 +56,7 @@ arthas.disabledCommands=stop,dump
比如: 比如:
- `./as.sh --telnet-port 9999` 传入的配置会覆盖掉`arthas.properties`里的默认值`arthas.telnetPort=3658`。 - `./as3.sh --telnet-port 9999` 传入的配置会覆盖掉`arthas.properties`里的默认值`arthas.telnetPort=3658`。
- 如果应用自身设置了 system properties `arthas.telnetPort=8888`,则会覆盖掉`arthas.properties`里的默认值`arthas.telnetPort=3658`。 - 如果应用自身设置了 system properties `arthas.telnetPort=8888`,则会覆盖掉`arthas.properties`里的默认值`arthas.telnetPort=3658`。
如果想要 `arthas.properties`的优先级最高,则可以配置 `arthas.config.overrideAll=true` 如果想要 `arthas.properties`的优先级最高,则可以配置 `arthas.config.overrideAll=true`

@ -28,7 +28,7 @@ watch com.alibaba.sample.petstore.web.store.module.screen.ItemList add "params +
为了避免这个问题Arthas 3.0 中使用了 ognl 这个更加轻量的表达式求值库来代替 groovy彻底解决了 groovy 引起的 FGC 风险。但由于这个替换,导致原来使用 groovy 脚本编写的自定义脚本失效。这个问题留待后续解决。 为了避免这个问题Arthas 3.0 中使用了 ognl 这个更加轻量的表达式求值库来代替 groovy彻底解决了 groovy 引起的 FGC 风险。但由于这个替换,导致原来使用 groovy 脚本编写的自定义脚本失效。这个问题留待后续解决。
在 3.0 中watch 命令的表达式部分的书写有了一些改变,详见[这里](https://arthas.aliyun.com/doc/watch) 在 3.0 中watch 命令的表达式部分的书写有了一些改变,详见[这里](https://arthas.aliyun.com/3.x/doc/watch)
#### 提升 rt 统计精度 #### 提升 rt 统计精度

@ -1,6 +1,6 @@
# Arthas 后台异步任务 # Arthas 后台异步任务
[`后台异步任务`在线教程](https://arthas.aliyun.com/doc/arthas-tutorials?language=cn&id=case-async-jobs) [`后台异步任务`在线教程](https://arthas.aliyun.com/3.x/doc/arthas-tutorials?language=cn&id=case-async-jobs)
arthas 中的后台异步任务,使用了仿 linux 系统任务相关的命令。[linux 任务相关介绍](https://ehlxr.me/2017/01/18/Linux-%E4%B8%AD-fg%E3%80%81bg%E3%80%81jobs%E3%80%81-%E6%8C%87%E4%BB%A4/)。 arthas 中的后台异步任务,使用了仿 linux 系统任务相关的命令。[linux 任务相关介绍](https://ehlxr.me/2017/01/18/Linux-%E4%B8%AD-fg%E3%80%81bg%E3%80%81jobs%E3%80%81-%E6%8C%87%E4%BB%A4/)。

@ -9,7 +9,7 @@
在 attach 时,可以在命令行指定密码。比如: 在 attach 时,可以在命令行指定密码。比如:
``` ```
java -jar arthas-boot.jar --password ppp java -jar arthas-boot3.jar --password ppp
``` ```
- 可以通过 `--username` 选项来指定用户,默认值是`arthas`。 - 可以通过 `--username` 选项来指定用户,默认值是`arthas`。

@ -32,13 +32,13 @@ sc -d org.apache.commons.lang.StringUtils
通过`-f`执行脚本文件,批处理脚本默认会输出到标准输出中,可以将结果重定向到文件中。 通过`-f`执行脚本文件,批处理脚本默认会输出到标准输出中,可以将结果重定向到文件中。
```bash ```bash
./as.sh -f /var/tmp/test.as <pid> > test.out # pid 可以通过 jps 命令查看 ./as3.sh -f /var/tmp/test.as <pid> > test.out # pid 可以通过 jps 命令查看
``` ```
也可以通过 `-c` 来指定指行的命令,比如 也可以通过 `-c` 来指定指行的命令,比如
```bash ```bash
./as.sh -c 'sysprop; thread' <pid> > test.out # pid 可以通过 jps 命令查看 ./as3.sh -c 'sysprop; thread' <pid> > test.out # pid 可以通过 jps 命令查看
``` ```
### 第三步:查看运行结果 ### 第三步:查看运行结果

@ -1,6 +1,6 @@
# cat # cat
[`cat`在线教程](https://arthas.aliyun.com/doc/arthas-tutorials.html?language=cn&id=command-cat) [`cat`在线教程](https://arthas.aliyun.com/3.x/doc/arthas-tutorials.html?language=cn&id=command-cat)
::: tip ::: tip
打印文件内容,和 linux 里的 cat 命令类似。 打印文件内容,和 linux 里的 cat 命令类似。

@ -1,6 +1,6 @@
# classloader # classloader
[`classloader`在线教程](https://arthas.aliyun.com/doc/arthas-tutorials?language=cn&id=command-classloader) [`classloader`在线教程](https://arthas.aliyun.com/3.x/doc/arthas-tutorials?language=cn&id=command-classloader)
::: tip ::: tip
查看 classloader 的继承树urls类加载信息 查看 classloader 的继承树urls类加载信息

@ -1,6 +1,6 @@
# dashboard # dashboard
[`dashboard`在线教程](https://arthas.aliyun.com/doc/arthas-tutorials.html?language=cn&id=command-dashboard) [`dashboard`在线教程](https://arthas.aliyun.com/3.x/doc/arthas-tutorials.html?language=cn&id=command-dashboard)
::: tip ::: tip
当前系统的实时数据面板,按 ctrl+c 退出。 当前系统的实时数据面板,按 ctrl+c 退出。

@ -67,10 +67,10 @@ RUN export JAVA_HOME
$ docker run --name math-game -it hengyunabc/arthas:latest /bin/sh -c "java -jar /opt/arthas/math-game.jar" $ docker run --name math-game -it hengyunabc/arthas:latest /bin/sh -c "java -jar /opt/arthas/math-game.jar"
``` ```
1. 启动`arthas-boot`来进行诊断 1. 启动`arthas-boot3`来进行诊断
```sh ```sh
$ docker exec -it math-game /bin/sh -c "java -jar /opt/arthas/arthas-boot.jar" $ docker exec -it math-game /bin/sh -c "java -jar /opt/arthas/arthas-boot3.jar"
* [1]: 9 jar * [1]: 9 jar
[INFO] arthas home: /opt/arthas [INFO] arthas home: /opt/arthas
@ -84,7 +84,7 @@ RUN export JAVA_HOME
`--' `--'`--' '--' `--' `--' `--'`--' `--'`-----' `--' `--'`--' '--' `--' `--' `--'`--' `--'`-----'
wiki: https://arthas.aliyun.com/doc wiki: https://arthas.aliyun.com/3.x/doc
version: 3.0.5 version: 3.0.5
pid: 9 pid: 9
time: 2018-12-18 11:30:36 time: 2018-12-18 11:30:36
@ -93,13 +93,13 @@ RUN export JAVA_HOME
## 诊断 Docker 里的 Java 进程 ## 诊断 Docker 里的 Java 进程
```sh ```sh
docker exec -it ${containerId} /bin/bash -c "wget https://arthas.aliyun.com/arthas-boot.jar && java -jar arthas-boot.jar" docker exec -it ${containerId} /bin/bash -c "wget https://arthas.aliyun.com/arthas-boot3.jar && java -jar arthas-boot3.jar"
``` ```
## 诊断 k8s 里容器里的 Java 进程 ## 诊断 k8s 里容器里的 Java 进程
```sh ```sh
kubectl exec -it ${pod} --container ${containerId} -- /bin/bash -c "wget https://arthas.aliyun.com/arthas-boot.jar && java -jar arthas-boot.jar" kubectl exec -it ${pod} --container ${containerId} -- /bin/bash -c "wget https://arthas.aliyun.com/arthas-boot3.jar && java -jar arthas-boot3.jar"
``` ```
## 把 Arthas 安装到基础镜像里 ## 把 Arthas 安装到基础镜像里

@ -2,42 +2,34 @@
## 下载全量包 ## 下载全量包
### 从 Maven 仓库下载
最新版本,点击下载:[![](https://img.shields.io/maven-central/v/com.taobao.arthas/arthas-packaging.svg?style=flat-square "Arthas")](https://arthas.aliyun.com/download/latest_version?mirror=aliyun)
### 从 Github Releases 页下载 ### 从 Github Releases 页下载
[https://github.com/alibaba/arthas/releases](https://github.com/alibaba/arthas/releases) [https://github.com/alibaba/arthas/releases](https://github.com/alibaba/arthas/releases)
### 用 as.sh 启动 ### 用 as3.sh 启动
解压后,在文件夹里有`as.sh`,直接用`./as.sh`的方式启动: 解压后,在文件夹里有`as3.sh`,直接用`./as3.sh`的方式启动:
```bash ```bash
./as.sh ./as3.sh
``` ```
打印帮助信息: 打印帮助信息:
```bash ```bash
./as.sh -h ./as3.sh -h
``` ```
### 用 arthas-boot 启动 ### 用 arthas-boot3 启动
或者在解压后,在文件夹里有`arthas-boot.jar`,直接用`java -jar`的方式启动: 或者在解压后,在文件夹里有`arthas-boot3.jar`,直接用`java -jar`的方式启动:
```bash ```bash
java -jar arthas-boot.jar java -jar arthas-boot3.jar
``` ```
打印帮助信息: 打印帮助信息:
```bash ```bash
java -jar arthas-boot.jar -h java -jar arthas-boot3.jar -h
``` ```
## 下载离线文档
下载文档:[![](https://img.shields.io/maven-central/v/com.taobao.arthas/arthas-packaging.svg?style=flat-square "Arthas")](https://arthas.aliyun.com/download/doc/latest_version?mirror=aliyun)

@ -1,6 +1,6 @@
# dump # dump
[`dump`在线教程](https://arthas.aliyun.com/doc/arthas-tutorials?language=cn&id=command-dump) [`dump`在线教程](https://arthas.aliyun.com/3.x/doc/arthas-tutorials?language=cn&id=command-dump)
::: tip ::: tip
dump 已加载类的 bytecode 到特定目录 dump 已加载类的 bytecode 到特定目录

@ -1,6 +1,6 @@
# echo # echo
[`echo`在线教程](https://arthas.aliyun.com/doc/arthas-tutorials.html?language=cn&id=command-echo) [`echo`在线教程](https://arthas.aliyun.com/3.x/doc/arthas-tutorials.html?language=cn&id=command-echo)
::: tip ::: tip
打印参数,和 linux 里的 echo 命令类似。 打印参数,和 linux 里的 echo 命令类似。

@ -106,6 +106,6 @@ ognl '@java.lang.System@out.println("Hello \u4e2d\u6587")'
### 为什么下载了新版本的 Arthas连接的却是旧版本 ### 为什么下载了新版本的 Arthas连接的却是旧版本
比如启动的 `as.sh/arthas-boot.jar` 版本是 3.5._ 的,但是连接上之后,打印的 arthas 版本是 3.4._ 的。 比如启动的 `as3.sh/arthas-boot3.jar` 版本是 3.5._ 的,但是连接上之后,打印的 arthas 版本是 3.4._ 的。
可能是之前使用旧版本的 arthas 诊断过目标进程。可以先执行`stop`停止掉旧版本的 arthas再重新使用新版本 attach。 可能是之前使用旧版本的 arthas 诊断过目标进程。可以先执行`stop`停止掉旧版本的 arthas再重新使用新版本 attach。

@ -1,6 +1,6 @@
# getstatic # getstatic
[`getstatic`在线教程](https://arthas.aliyun.com/doc/arthas-tutorials.html?language=cn&id=command-getstatic) [`getstatic`在线教程](https://arthas.aliyun.com/3.x/doc/arthas-tutorials.html?language=cn&id=command-getstatic)
### 使用参考 ### 使用参考

@ -1,6 +1,6 @@
# grep # grep
[`grep`在线教程](https://arthas.aliyun.com/doc/arthas-tutorials.html?language=cn&id=command-grep) [`grep`在线教程](https://arthas.aliyun.com/3.x/doc/arthas-tutorials.html?language=cn&id=command-grep)
::: tip ::: tip
类似传统的`grep`命令。 类似传统的`grep`命令。
@ -24,7 +24,7 @@
thread | grep -m 10 -e "TIMED_WAITING|WAITING" thread | grep -m 10 -e "TIMED_WAITING|WAITING"
WIKI: WIKI:
https://arthas.aliyun.com/doc/grep https://arthas.aliyun.com/3.x/doc/grep
OPTIONS: OPTIONS:
-A, --after-context <value> Print NUM lines of trailing context) -A, --after-context <value> Print NUM lines of trailing context)

@ -1,6 +1,6 @@
# heapdump # heapdump
[`heapdump`在线教程](https://arthas.aliyun.com/doc/arthas-tutorials.html?language=cn&id=command-heapdump) [`heapdump`在线教程](https://arthas.aliyun.com/3.x/doc/arthas-tutorials.html?language=cn&id=command-heapdump)
::: tip ::: tip
dump java heap, 类似 jmap 命令的 heap dump 功能。 dump java heap, 类似 jmap 命令的 heap dump 功能。

@ -78,7 +78,7 @@ $ help
dashboard -i 2000 dashboard -i 2000
WIKI: WIKI:
https://arthas.aliyun.com/doc/dashboard https://arthas.aliyun.com/3.x/doc/dashboard
OPTIONS: OPTIONS:
-h, --help this help -h, --help this help

@ -1,6 +1,6 @@
# Http API # Http API
[`Http API`在线教程](https://arthas.aliyun.com/doc/arthas-tutorials.html?language=cn&id=case-http-api) [`Http API`在线教程](https://arthas.aliyun.com/3.x/doc/arthas-tutorials.html?language=cn&id=case-http-api)
## 概览 ## 概览
@ -253,12 +253,12 @@ while true; do curl -Ss -XPOST http://localhost:8563/api -d '
"message": "Welcome to arthas!" "message": "Welcome to arthas!"
}, },
{ {
"tutorials": "https://arthas.aliyun.com/doc/arthas-tutorials.html", "tutorials": "https://arthas.aliyun.com/3.x/doc/arthas-tutorials.html",
"time": "2020-08-06 15:56:43", "time": "2020-08-06 15:56:43",
"type": "welcome", "type": "welcome",
"jobId": 0, "jobId": 0,
"pid": "7909", "pid": "7909",
"wiki": "https://arthas.aliyun.com/doc", "wiki": "https://arthas.aliyun.com/3.x/doc",
"version": "3.3.7" "version": "3.3.7"
}, },
{ {

@ -2,55 +2,57 @@
## 快速安装 ## 快速安装
### 使用`arthas-boot`(推荐) ### 使用`arthas-boot3`(推荐)
下载`arthas-boot.jar`,然后用`java -jar`的方式启动: 下载`arthas-boot3.jar`,然后用`java -jar`的方式启动:
```bash ```bash
curl -O https://arthas.aliyun.com/arthas-boot.jar curl -O https://arthas.aliyun.com/arthas-boot3.jar
java -jar arthas-boot.jar java -jar arthas-boot3.jar
``` ```
打印帮助信息: 打印帮助信息:
```bash ```bash
java -jar arthas-boot.jar -h java -jar arthas-boot3.jar -h
``` ```
- 如果下载速度比较慢,可以使用 aliyun 的镜像: - 如果下载速度比较慢,可以使用 aliyun 的镜像:
```bash ```bash
java -jar arthas-boot.jar --repo-mirror aliyun --use-http java -jar arthas-boot3.jar --repo-mirror aliyun --use-http
``` ```
### 使用`as.sh` ### 使用`as3.sh`
Arthas 支持在 Linux/Unix/Mac 等平台上一键安装,请复制以下内容,并粘贴到命令行中,敲 `回车` 执行即可: Arthas 支持在 Linux/Unix/Mac 等平台上一键安装,请复制以下内容,并粘贴到命令行中,敲 `回车` 执行即可:
```bash ```bash
curl -L https://arthas.aliyun.com/install.sh | sh curl -L https://arthas.aliyun.com/install3.sh | sh
``` ```
上述命令会下载启动脚本文件 `as.sh` 到当前目录,你可以放在任何地方或将其加入到 `$PATH` 中。 上述命令会下载启动脚本文件 `as3.sh` 到当前目录,你可以放在任何地方或将其加入到 `$PATH` 中。
直接在 shell 下面执行`./as.sh`,就会进入交互界面。 直接在 shell 下面执行`./as3.sh`,就会进入交互界面。
也可以执行`./as.sh -h`来获取更多参数信息。 也可以执行`./as3.sh -h`来获取更多参数信息。
## 全量安装 ## 全量安装
最新版本,点击下载:[![](https://img.shields.io/maven-central/v/com.taobao.arthas/arthas-packaging.svg?style=flat-square "Arthas")](https://arthas.aliyun.com/download/latest_version?mirror=aliyun) 从 Github Releases 页下载
解压后,在文件夹里有`arthas-boot.jar`,直接用`java -jar`的方式启动: [https://github.com/alibaba/arthas/releases](https://github.com/alibaba/arthas/releases)
解压后,在文件夹里有`arthas-boot3.jar`,直接用`java -jar`的方式启动:
```bash ```bash
java -jar arthas-boot.jar java -jar arthas-boot3.jar
``` ```
打印帮助信息: 打印帮助信息:
```bash ```bash
java -jar arthas-boot.jar -h java -jar arthas-boot3.jar -h
``` ```
## 手动安装 ## 手动安装
@ -78,17 +80,13 @@ sudo rpm -i arthas*.rpm
在安装后,可以直接执行: 在安装后,可以直接执行:
```bash ```bash
as.sh as3.sh
``` ```
## 通过 Cloud Toolkit 插件使用 Arthas ## 通过 Cloud Toolkit 插件使用 Arthas
- [通过 Cloud Toolkit 插件使用 Arthas 一键诊断远程服务器](https://github.com/alibaba/arthas/issues/570) - [通过 Cloud Toolkit 插件使用 Arthas 一键诊断远程服务器](https://github.com/alibaba/arthas/issues/570)
## 离线帮助文档
最新版本离线文档下载:[![](https://img.shields.io/maven-central/v/com.taobao.arthas/arthas-packaging.svg?style=flat-square "Arthas")](https://arthas.aliyun.com/download/doc/latest_version?mirror=aliyun)
## 卸载 ## 卸载
- 在 Linux/Unix/Mac 平台 - 在 Linux/Unix/Mac 平台

@ -1,6 +1,6 @@
# jad # jad
[`jad`在线教程](https://arthas.aliyun.com/doc/arthas-tutorials?language=cn&id=command-jad) [`jad`在线教程](https://arthas.aliyun.com/3.x/doc/arthas-tutorials?language=cn&id=command-jad)
::: tip ::: tip
反编译指定已加载类的源码 反编译指定已加载类的源码

@ -1,6 +1,6 @@
# jfr # jfr
[`jfr`在线教程](https://arthas.aliyun.com/doc/arthas-tutorials.html?language=cn&id=command-jfr) [`jfr`在线教程](https://arthas.aliyun.com/3.x/doc/arthas-tutorials.html?language=cn&id=command-jfr)
::: tip ::: tip
Java Flight Recorder (JFR) 是一种用于收集有关正在运行的 Java 应用程序的诊断和分析数据的工具。它集成到 Java 虚拟机 (JVM) 中,几乎不会造成性能开销,因此即使在负载较重的生产环境中也可以使用。 Java Flight Recorder (JFR) 是一种用于收集有关正在运行的 Java 应用程序的诊断和分析数据的工具。它集成到 Java 虚拟机 (JVM) 中,几乎不会造成性能开销,因此即使在负载较重的生产环境中也可以使用。

@ -1,6 +1,6 @@
# jvm # jvm
[`jvm`在线教程](https://arthas.aliyun.com/doc/arthas-tutorials.html?language=cn&id=command-jvm) [`jvm`在线教程](https://arthas.aliyun.com/3.x/doc/arthas-tutorials.html?language=cn&id=command-jvm)
::: tip ::: tip
查看当前 JVM 信息 查看当前 JVM 信息

@ -1,6 +1,6 @@
# keymap # keymap
[`keymap`在线教程](https://arthas.aliyun.com/doc/arthas-tutorials.html?language=cn&id=command-keymap) [`keymap`在线教程](https://arthas.aliyun.com/3.x/doc/arthas-tutorials.html?language=cn&id=command-keymap)
`keymap`命令输出当前的快捷键映射表: `keymap`命令输出当前的快捷键映射表:

@ -1,6 +1,6 @@
# logger # logger
[`logger`在线教程](https://arthas.aliyun.com/doc/arthas-tutorials?language=cn&id=command-logger) [`logger`在线教程](https://arthas.aliyun.com/3.x/doc/arthas-tutorials?language=cn&id=command-logger)
::: tip ::: tip
查看 logger 信息,更新 logger level 查看 logger 信息,更新 logger level

@ -2,7 +2,9 @@
1. 下载最新版本 1. 下载最新版本
**最新版本,点击下载**[![](https://img.shields.io/maven-central/v/com.taobao.arthas/arthas-packaging.svg?style=flat-square "Arthas")](https://arthas.aliyun.com/download/latest_version?mirror=aliyun) 从 Github Releases 页下载
[https://github.com/alibaba/arthas/releases](https://github.com/alibaba/arthas/releases)
2. 解压缩 arthas 的压缩包 2. 解压缩 arthas 的压缩包
@ -18,7 +20,7 @@
sudo su admin sudo su admin
rm -rf /home/admin/.arthas/lib/* rm -rf /home/admin/.arthas/lib/*
cd arthas cd arthas
./install-local.sh ./install-local3.sh
``` ```
::: warning ::: warning
@ -30,24 +32,24 @@
启动之前,请确保老版本的 Arthas 已经`stop`. 启动之前,请确保老版本的 Arthas 已经`stop`.
``` ```
./as.sh ./as3.sh
``` ```
## 以脚本的方式启动 as.sh/as.bat ## 以脚本的方式启动 as3.sh/as.bat
### Linux/Unix/Mac ### Linux/Unix/Mac
Arthas 支持在 Linux/Unix/Mac 等平台上一键安装,请复制以下内容,并粘贴到命令行中,敲 `回车` 执行即可: Arthas 支持在 Linux/Unix/Mac 等平台上一键安装,请复制以下内容,并粘贴到命令行中,敲 `回车` 执行即可:
```bash ```bash
curl -L https://arthas.aliyun.com/install.sh | sh curl -L https://arthas.aliyun.com/install3.sh | sh
``` ```
上述命令会下载启动脚本文件 `as.sh` 到当前目录,你可以放在任何地方或将其加入到 `$PATH` 中。 上述命令会下载启动脚本文件 `as3.sh` 到当前目录,你可以放在任何地方或将其加入到 `$PATH` 中。
直接在 shell 下面执行`./as.sh`,就会进入交互界面。 直接在 shell 下面执行`./as3.sh`,就会进入交互界面。
也可以执行`./as.sh -h`来获取更多参数信息。 也可以执行`./as3.sh -h`来获取更多参数信息。
### Windows ### Windows

@ -1,6 +1,6 @@
# mbean # mbean
[`mbean`在线教程](https://arthas.aliyun.com/doc/arthas-tutorials.html?language=cn&id=command-mbean) [`mbean`在线教程](https://arthas.aliyun.com/3.x/doc/arthas-tutorials.html?language=cn&id=command-mbean)
::: tip ::: tip
查看 Mbean 的信息 查看 Mbean 的信息

@ -1,6 +1,6 @@
# mc # mc
[`mc-retransform`在线教程](https://arthas.aliyun.com/doc/arthas-tutorials?language=cn&id=command-mc-retransform) [`mc-retransform`在线教程](https://arthas.aliyun.com/3.x/doc/arthas-tutorials?language=cn&id=command-mc-retransform)
## 使用参考 ## 使用参考

@ -1,6 +1,6 @@
# monitor # monitor
[`monitor`在线教程](https://arthas.aliyun.com/doc/arthas-tutorials.html?language=cn&id=command-monitor) [`monitor`在线教程](https://arthas.aliyun.com/3.x/doc/arthas-tutorials.html?language=cn&id=command-monitor)
::: tip ::: tip
方法执行监控 方法执行监控

@ -1,6 +1,6 @@
# ognl # ognl
[`ognl`在线教程](https://arthas.aliyun.com/doc/arthas-tutorials?language=cn&id=command-ognl) [`ognl`在线教程](https://arthas.aliyun.com/3.x/doc/arthas-tutorials?language=cn&id=command-ognl)
::: tip ::: tip
执行 ognl 表达式 执行 ognl 表达式

@ -1,6 +1,6 @@
# options # options
[`options`在线教程](https://arthas.aliyun.com/doc/arthas-tutorials.html?language=cn&id=command-options) [`options`在线教程](https://arthas.aliyun.com/3.x/doc/arthas-tutorials.html?language=cn&id=command-options)
::: tip ::: tip
全局开关 全局开关

@ -1,6 +1,6 @@
# perfcounter # perfcounter
[`perfcounter`在线教程](https://arthas.aliyun.com/doc/arthas-tutorials.html?language=cn&id=command-perfcounter) [`perfcounter`在线教程](https://arthas.aliyun.com/3.x/doc/arthas-tutorials.html?language=cn&id=command-perfcounter)
::: tip ::: tip
查看当前 JVM 的 Perf Counter 信息 查看当前 JVM 的 Perf Counter 信息

@ -1,6 +1,6 @@
# profiler # profiler
[`profiler`在线教程](https://arthas.aliyun.com/doc/arthas-tutorials.html?language=cn&id=command-profiler) [`profiler`在线教程](https://arthas.aliyun.com/3.x/doc/arthas-tutorials.html?language=cn&id=command-profiler)
::: tip ::: tip
使用[async-profiler](https://github.com/jvm-profiling-tools/async-profiler)生成火焰图 使用[async-profiler](https://github.com/jvm-profiling-tools/async-profiler)生成火焰图

@ -1,6 +1,6 @@
# pwd # pwd
[`pwd`在线教程](https://arthas.aliyun.com/doc/arthas-tutorials.html?language=cn&id=command-pwd) [`pwd`在线教程](https://arthas.aliyun.com/3.x/doc/arthas-tutorials.html?language=cn&id=command-pwd)
::: tip ::: tip
返回当前的工作目录,和 linux 命令类似 返回当前的工作目录,和 linux 命令类似

@ -1,6 +1,6 @@
# 快速入门 # 快速入门
可以通过下面的方式自己动手实践,也可以通过我们的[在线教程](https://arthas.aliyun.com/doc/arthas-tutorials.html?language=cn&id=arthas-basics),跟随教程快速入门。 可以通过下面的方式自己动手实践,也可以通过我们的[在线教程](https://arthas.aliyun.com/3.x/doc/arthas-tutorials.html?language=cn&id=arthas-basics),跟随教程快速入门。
## 1. 启动 math-game ## 1. 启动 math-game
@ -18,19 +18,19 @@ java -jar math-game.jar
在命令行下面执行(使用和目标进程一致的用户启动,否则可能 attach 失败): 在命令行下面执行(使用和目标进程一致的用户启动,否则可能 attach 失败):
```bash ```bash
curl -O https://arthas.aliyun.com/arthas-boot.jar curl -O https://arthas.aliyun.com/arthas-boot3.jar
java -jar arthas-boot.jar java -jar arthas-boot3.jar
``` ```
- 执行该程序的用户需要和目标进程具有相同的权限。比如以`admin`用户来执行:`sudo su admin && java -jar arthas-boot.jar` 或 `sudo -u admin -EH java -jar arthas-boot.jar`。 - 执行该程序的用户需要和目标进程具有相同的权限。比如以`admin`用户来执行:`sudo su admin && java -jar arthas-boot3.jar` 或 `sudo -u admin -EH java -jar arthas-boot3.jar`。
- 如果 attach 不上目标进程,可以查看`~/logs/arthas/` 目录下的日志。 - 如果 attach 不上目标进程,可以查看`~/logs/arthas/` 目录下的日志。
- 如果下载速度比较慢,可以使用 aliyun 的镜像:`java -jar arthas-boot.jar --repo-mirror aliyun --use-http` - 如果下载速度比较慢,可以使用 aliyun 的镜像:`java -jar arthas-boot3.jar --repo-mirror aliyun --use-http`
- `java -jar arthas-boot.jar -h` 打印更多参数信息。 - `java -jar arthas-boot3.jar -h` 打印更多参数信息。
选择应用 java 进程: 选择应用 java 进程:
```bash ```bash
$ $ java -jar arthas-boot.jar $ $ java -jar arthas-boot3.jar
* [1]: 35542 * [1]: 35542
[2]: 71560 math-game.jar [2]: 71560 math-game.jar
``` ```
@ -48,7 +48,7 @@ $ $ java -jar arthas-boot.jar
`--' `--'`--' '--' `--' `--' `--'`--' `--'`-----' `--' `--'`--' '--' `--' `--' `--'`--' `--'`-----'
wiki: https://arthas.aliyun.com/doc wiki: https://arthas.aliyun.com/3.x/doc
version: 3.0.5.20181127201536 version: 3.0.5.20181127201536
pid: 71560 pid: 71560
time: 2018-11-28 19:16:24 time: 2018-11-28 19:16:24
@ -223,7 +223,7 @@ ts=2018-11-28 19:22:35; [cost=29.969732ms] result=@ArrayList[
] ]
``` ```
更多的功能可以查看[进阶教程](https://arthas.aliyun.com/doc/arthas-tutorials.html?language=cn&id=arthas-advanced)。 更多的功能可以查看[进阶教程](https://arthas.aliyun.com/3.x/doc/arthas-tutorials.html?language=cn&id=arthas-advanced)。
## 7. 退出 arthas ## 7. 退出 arthas

@ -4,7 +4,7 @@
推荐使用 [retransform](retransform.md) 命令 推荐使用 [retransform](retransform.md) 命令
::: :::
[`mc-redefine`在线教程](https://arthas.aliyun.com/doc/arthas-tutorials?language=cn&id=command-mc-redefine) [`mc-redefine`在线教程](https://arthas.aliyun.com/3.x/doc/arthas-tutorials?language=cn&id=command-mc-redefine)
::: tip ::: tip
加载外部的`.class`文件redefine jvm 已加载的类。 加载外部的`.class`文件redefine jvm 已加载的类。

@ -1,6 +1,6 @@
# reset # reset
[`reset`在线教程](https://arthas.aliyun.com/doc/arthas-tutorials.html?language=cn&id=command-reset) [`reset`在线教程](https://arthas.aliyun.com/3.x/doc/arthas-tutorials.html?language=cn&id=command-reset)
::: tip ::: tip
重置增强类,将被 Arthas 增强过的类全部还原Arthas 服务端`stop`时会重置所有增强过的类 重置增强类,将被 Arthas 增强过的类全部还原Arthas 服务端`stop`时会重置所有增强过的类

@ -1,6 +1,6 @@
# retransform # retransform
[`mc-retransform`在线教程](https://arthas.aliyun.com/doc/arthas-tutorials?language=cn&id=command-mc-retransform) [`mc-retransform`在线教程](https://arthas.aliyun.com/3.x/doc/arthas-tutorials?language=cn&id=command-mc-retransform)
::: tip ::: tip
加载外部的`.class`文件retransform jvm 已加载的类。 加载外部的`.class`文件retransform jvm 已加载的类。

@ -1,6 +1,6 @@
# 执行结果存日志 # 执行结果存日志
[`执行结果存日志`在线教程](https://arthas.aliyun.com/doc/arthas-tutorials.html?language=cn&id=save-log) [`执行结果存日志`在线教程](https://arthas.aliyun.com/3.x/doc/arthas-tutorials.html?language=cn&id=save-log)
::: tip ::: tip
将命令的结果完整保存在日志文件中,便于后续进行分析 将命令的结果完整保存在日志文件中,便于后续进行分析

@ -1,6 +1,6 @@
# sc # sc
[`sc`在线教程](https://arthas.aliyun.com/doc/arthas-tutorials?language=cn&id=command-sc) [`sc`在线教程](https://arthas.aliyun.com/3.x/doc/arthas-tutorials?language=cn&id=command-sc)
::: tip ::: tip
查看 JVM 已加载的类信息 查看 JVM 已加载的类信息

@ -1,6 +1,6 @@
# sm # sm
[`sm`在线教程](https://arthas.aliyun.com/doc/arthas-tutorials?language=cn&id=command-sm) [`sm`在线教程](https://arthas.aliyun.com/3.x/doc/arthas-tutorials?language=cn&id=command-sm)
::: tip ::: tip
查看已加载类的方法信息 查看已加载类的方法信息

@ -1,6 +1,6 @@
# stack # stack
[`stack`在线教程](https://arthas.aliyun.com/doc/arthas-tutorials.html?language=cn&id=command-stack) [`stack`在线教程](https://arthas.aliyun.com/3.x/doc/arthas-tutorials.html?language=cn&id=command-stack)
::: tip ::: tip
输出当前方法被调用的调用路径 输出当前方法被调用的调用路径

@ -3,11 +3,11 @@
## 交互模式启动 ## 交互模式启动
```bash ```bash
./as.sh ./as3.sh
``` ```
```bash ```bash
➜ bin git:(develop) ✗ ./as.sh ➜ bin git:(develop) ✗ ./as3.sh
Found existing java process, please choose one and input the serial number of the process, eg: 1 . Then hit ENTER. Found existing java process, please choose one and input the serial number of the process, eg: 1 . Then hit ENTER.
[1]: 3088 org.jetbrains.idea.maven.server.RemoteMavenServer [1]: 3088 org.jetbrains.idea.maven.server.RemoteMavenServer
* [2]: 12872 org.apache.catalina.startup.Bootstrap * [2]: 12872 org.apache.catalina.startup.Bootstrap
@ -26,7 +26,7 @@ $
启动脚本如下: 启动脚本如下:
```bash ```bash
./as.sh <PID>[@IP:PORT] ./as3.sh <PID>[@IP:PORT]
``` ```
### 参数说明 ### 参数说明
@ -39,11 +39,11 @@ $
- 如果不指定 IP 和 PORT默认是 127.0.0.1 和 3658 - 如果不指定 IP 和 PORT默认是 127.0.0.1 和 3658
> ./as.sh 12345 > ./as3.sh 12345
上述命令等价于: 上述命令等价于:
> ./as.sh 12356@127.0.0.1:3658 > ./as3.sh 12356@127.0.0.1:3658
### 远程诊断 ### 远程诊断
@ -55,10 +55,10 @@ telnet 192.168.1.119 3658
### sudo 支持 ### sudo 支持
成熟的线上管理环境一般都不会直接开放 JVM 部署用户权限给你,而是通过 sudo-list 来控制和监控用户的越权操作。由于 as.sh 脚本中会对当前用户的环境变量产生感知,所以需要加上 -H 参数 成熟的线上管理环境一般都不会直接开放 JVM 部署用户权限给你,而是通过 sudo-list 来控制和监控用户的越权操作。由于 as3.sh 脚本中会对当前用户的环境变量产生感知,所以需要加上 -H 参数
```bash ```bash
sudo -u admin -H ./as.sh 12345 sudo -u admin -H ./as3.sh 12345
``` ```
### Windows 环境支持 ### Windows 环境支持

@ -1,6 +1,6 @@
# sysenv # sysenv
[`sysenv`在线教程](https://arthas.aliyun.com/doc/arthas-tutorials.html?language=cn&id=command-sysenv) [`sysenv`在线教程](https://arthas.aliyun.com/3.x/doc/arthas-tutorials.html?language=cn&id=command-sysenv)
::: tip ::: tip
查看当前 JVM 的环境属性(`System Environment Variables`) 查看当前 JVM 的环境属性(`System Environment Variables`)
@ -20,7 +20,7 @@
sysenv USER sysenv USER
WIKI: WIKI:
https://arthas.aliyun.com/doc/sysenv https://arthas.aliyun.com/3.x/doc/sysenv
OPTIONS: OPTIONS:
-h, --help this help -h, --help this help

@ -1,6 +1,6 @@
# sysprop # sysprop
[`sysprop`在线教程](https://arthas.aliyun.com/doc/arthas-tutorials.html?language=cn&id=command-sysprop) [`sysprop`在线教程](https://arthas.aliyun.com/3.x/doc/arthas-tutorials.html?language=cn&id=command-sysprop)
::: tip ::: tip
查看当前 JVM 的系统属性(`System Property`) 查看当前 JVM 的系统属性(`System Property`)
@ -21,7 +21,7 @@
sysprop production.mode true sysprop production.mode true
WIKI: WIKI:
https://arthas.aliyun.com/doc/sysprop https://arthas.aliyun.com/3.x/doc/sysprop
OPTIONS: OPTIONS:
-h, --help this help -h, --help this help

@ -1,6 +1,6 @@
# tee # tee
[`tee`在线教程](https://arthas.aliyun.com/doc/arthas-tutorials.html?language=cn&id=command-tee) [`tee`在线教程](https://arthas.aliyun.com/3.x/doc/arthas-tutorials.html?language=cn&id=command-tee)
::: tip ::: tip
类似传统的`tee`命令, 用于读取标准输入的数据,并将其内容输出成文件。 类似传统的`tee`命令, 用于读取标准输入的数据,并将其内容输出成文件。
@ -22,7 +22,7 @@ tee 指令会从标准输入设备读取数据,将其内容输出到标准输
sysprop | tee -a /path/to/logfile | grep java sysprop | tee -a /path/to/logfile | grep java
WIKI: WIKI:
https://arthas.aliyun.com/doc/tee https://arthas.aliyun.com/3.x/doc/tee
OPTIONS: OPTIONS:
-a, --append Append to file -a, --append Append to file

@ -1,6 +1,6 @@
# thread # thread
[`thread`在线教程](https://arthas.aliyun.com/doc/arthas-tutorials.html?language=cn&id=command-thread) [`thread`在线教程](https://arthas.aliyun.com/3.x/doc/arthas-tutorials.html?language=cn&id=command-thread)
::: tip ::: tip
查看当前线程信息,查看线程的堆栈 查看当前线程信息,查看线程的堆栈

@ -1,6 +1,6 @@
# trace # trace
[`trace`在线教程](https://arthas.aliyun.com/doc/arthas-tutorials.html?language=cn&id=command-trace) [`trace`在线教程](https://arthas.aliyun.com/3.x/doc/arthas-tutorials.html?language=cn&id=command-trace)
::: tip ::: tip
方法内部调用路径,并输出方法路径上的每个节点上耗时 方法内部调用路径,并输出方法路径上的每个节点上耗时

@ -1,6 +1,6 @@
# tt # tt
[`tt`在线教程](https://arthas.aliyun.com/doc/arthas-tutorials.html?language=cn&id=command-tt) [`tt`在线教程](https://arthas.aliyun.com/3.x/doc/arthas-tutorials.html?language=cn&id=command-tt)
::: tip ::: tip
方法执行数据的时空隧道,记录下指定方法每次调用的入参和返回信息,并能对这些不同的时间下调用进行观测 方法执行数据的时空隧道,记录下指定方法每次调用的入参和返回信息,并能对这些不同的时间下调用进行观测

@ -15,8 +15,6 @@
[https://github.com/alibaba/arthas/releases](https://github.com/alibaba/arthas/releases) [https://github.com/alibaba/arthas/releases](https://github.com/alibaba/arthas/releases)
- 从 Maven 仓库下载:[![](https://img.shields.io/maven-central/v/com.taobao.arthas/arthas-packaging.svg?style=flat-square "Arthas")](https://arthas.aliyun.com/download/arthas-tunnel-server/latest_version?mirror=aliyun)
- 从 Github Releases 页下载: [https://github.com/alibaba/arthas/releases](https://github.com/alibaba/arthas/releases) - 从 Github Releases 页下载: [https://github.com/alibaba/arthas/releases](https://github.com/alibaba/arthas/releases)
Arthas tunnel server 是一个 spring boot fat jar 应用,直接`java -jar`启动: Arthas tunnel server 是一个 spring boot fat jar 应用,直接`java -jar`启动:
@ -42,13 +40,13 @@ Using generated security password: f1dca050-3777-48f4-a577-6367e55a78a2
在启动 arthas可以传递`--tunnel-server`参数,比如: 在启动 arthas可以传递`--tunnel-server`参数,比如:
```bash ```bash
as.sh --tunnel-server 'ws://127.0.0.1:7777/ws' as3.sh --tunnel-server 'ws://127.0.0.1:7777/ws'
``` ```
也可以使用下面的测试地址(不保证一直可用): 也可以使用下面的测试地址(不保证一直可用):
```bash ```bash
as.sh --tunnel-server 'ws://47.75.156.201:80/ws' as3.sh --tunnel-server 'ws://47.75.156.201:80/ws'
``` ```
- 如果有特殊需求,可以通过`--agent-id`参数里指定 agentId。默认情况下会生成随机 ID。 - 如果有特殊需求,可以通过`--agent-id`参数里指定 agentId。默认情况下会生成随机 ID。
@ -63,8 +61,8 @@ attach 成功之后,会打印出 agentId比如
`--' `--'`--' '--' `--' `--' `--'`--' `--'`-----' `--' `--'`--' '--' `--' `--' `--'`--' `--'`-----'
wiki https://arthas.aliyun.com/doc wiki https://arthas.aliyun.com/3.x/doc
tutorials https://arthas.aliyun.com/doc/arthas-tutorials.html tutorials https://arthas.aliyun.com/3.x/doc/arthas-tutorials.html
version 3.1.2 version 3.1.2
pid 86183 pid 86183
time 2019-08-30 15:40:53 time 2019-08-30 15:40:53
@ -95,7 +93,7 @@ id URJZ5L48RPBR2ALI5K4V
如果 arthas agent 配置了 `appName`,则生成的 agentId 会带上`appName`的前缀。 如果 arthas agent 配置了 `appName`,则生成的 agentId 会带上`appName`的前缀。
比如在加上启动参数:`as.sh --tunnel-server 'ws://127.0.0.1:7777/ws' --app-name demoapp` ,则生成的 agentId 可能是`demoapp_URJZ5L48RPBR2ALI5K4V`。 比如在加上启动参数:`as3.sh --tunnel-server 'ws://127.0.0.1:7777/ws' --app-name demoapp` ,则生成的 agentId 可能是`demoapp_URJZ5L48RPBR2ALI5K4V`。
Tunnel server 会以`_`做分隔符,提取出`appName`,方便按应用进行管理。 Tunnel server 会以`_`做分隔符,提取出`appName`,方便按应用进行管理。
@ -111,10 +109,10 @@ Tunnel server 会以`_`做分隔符,提取出`appName`,方便按应用进行
**注意,开放管理页面有风险!管理页面没有安全拦截功能,务必自行增加安全措施。** **注意,开放管理页面有风险!管理页面没有安全拦截功能,务必自行增加安全措施。**
::: :::
在本地启动 tunnel-server然后使用`as.sh` attach并且指定应用名`--app-name test` 在本地启动 tunnel-server然后使用`as3.sh` attach并且指定应用名`--app-name test`
``` ```
$ as.sh --tunnel-server 'ws://127.0.0.1:7777/ws' --app-name test $ as3.sh --tunnel-server 'ws://127.0.0.1:7777/ws' --app-name test
telnet connecting to arthas server... current timestamp is 1627539688 telnet connecting to arthas server... current timestamp is 1627539688
Trying 127.0.0.1... Trying 127.0.0.1...
Connected to 127.0.0.1. Connected to 127.0.0.1.
@ -126,8 +124,8 @@ Escape character is '^]'.
`--' `--'`--' '--' `--' `--' `--'`--' `--'`-----' `--' `--'`--' '--' `--' `--' `--'`--' `--'`-----'
wiki https://arthas.aliyun.com/doc wiki https://arthas.aliyun.com/3.x/doc
tutorials https://arthas.aliyun.com/doc/arthas-tutorials.html tutorials https://arthas.aliyun.com/3.x/doc/arthas-tutorials.html
version 3.5.3 version 3.5.3
main_class demo.MathGame main_class demo.MathGame
pid 65825 pid 65825

@ -1,6 +1,6 @@
# vmoption # vmoption
[`vmoption`在线教程](https://arthas.aliyun.com/doc/arthas-tutorials.html?language=cn&id=command-vmoption) [`vmoption`在线教程](https://arthas.aliyun.com/3.x/doc/arthas-tutorials.html?language=cn&id=command-vmoption)
::: tip ::: tip
查看,更新 VM 诊断相关的参数 查看,更新 VM 诊断相关的参数

@ -4,7 +4,7 @@
@since 3.5.1 @since 3.5.1
::: :::
[`vmtool`在线教程](https://arthas.aliyun.com/doc/arthas-tutorials.html?language=cn&id=command-vmtool) [`vmtool`在线教程](https://arthas.aliyun.com/3.x/doc/arthas-tutorials.html?language=cn&id=command-vmtool)
`vmtool` 利用`JVMTI`接口,实现查询内存对象,强制 GC 等功能。 `vmtool` 利用`JVMTI`接口,实现查询内存对象,强制 GC 等功能。

@ -1,6 +1,6 @@
# watch # watch
[`watch`在线教程](https://arthas.aliyun.com/doc/arthas-tutorials.html?language=cn&id=command-watch) [`watch`在线教程](https://arthas.aliyun.com/3.x/doc/arthas-tutorials.html?language=cn&id=command-watch)
::: tip ::: tip
函数执行数据观测 函数执行数据观测

@ -1,6 +1,6 @@
# Web Console # Web Console
[`Web Console`在线教程](https://arthas.aliyun.com/doc/arthas-tutorials.html?language=cn&id=case-web-console) [`Web Console`在线教程](https://arthas.aliyun.com/3.x/doc/arthas-tutorials.html?language=cn&id=case-web-console)
## 通过浏览器连接 arthas ## 通过浏览器连接 arthas

@ -69,11 +69,11 @@ It is convenient for running multiple commands in bulk with custom scripts. It c
- [Batch Processing](batch-support.md) - [Batch Processing](batch-support.md)
## as.sh and arthas-boot tips ## as3.sh and arthas-boot3 tips
- Select the process to be attached via the `select` option. - Select the process to be attached via the `select` option.
Normally, `as.sh`/`arthas-boot.jar` needs to a pid, bacause the pid will change. Normally, `as3.sh`/`arthas-boot3.jar` needs to a pid, bacause the pid will change.
For example, with `math-game.jar` already started, use the `jps` command to see. For example, with `math-game.jar` already started, use the `jps` command to see.
@ -86,7 +86,7 @@ $ jps
The `select` option allows you to specify a process name, which is very convenient. The `select` option allows you to specify a process name, which is very convenient.
```bash ```bash
$ ./as.sh --select math-game $ ./as3.sh --select math-game
Arthas script version: 3.3.6 Arthas script version: 3.3.6
[INFO] JAVA_HOME: /tmp/java/8.0.222-zulu [INFO] JAVA_HOME: /tmp/java/8.0.222-zulu
Arthas home: /Users/admin/.arthas/lib/3.3.6/arthas Arthas home: /Users/admin/.arthas/lib/3.3.6/arthas
@ -108,8 +108,8 @@ Escape character is '^]'.
`--' `--'`--' '--' `--' `--' `--'`--' `--'`-----' `--' `--'`--' '--' `--' `--' `--'`--' `--'`-----'
wiki https://arthas.aliyun.com/doc wiki https://arthas.aliyun.com/3.x/doc
tutorials https://arthas.aliyun.com/doc/arthas-tutorials.html tutorials https://arthas.aliyun.com/3.x/doc/arthas-tutorials.html
version 3.3.6 version 3.3.6
pid 58883 pid 58883
``` ```
@ -118,7 +118,7 @@ pid 58883
After the `3.1.4` version, arthas support user data report. After the `3.1.4` version, arthas support user data report.
At startup, use the `stat-url` option, such as: `./as.sh --stat-url 'http://192.168.10.11:8080/api/stat'` At startup, use the `stat-url` option, such as: `./as3.sh --stat-url 'http://192.168.10.11:8080/api/stat'`
There is a sample data report in the tunnel server that users can implement on their own. There is a sample data report in the tunnel server that users can implement on their own.

@ -56,7 +56,7 @@ The order of configuration is: command line parameters > System Env > System Pro
such as: such as:
- `./as.sh --telnet-port 9999` command line configuration will overwrite the default value `arthas.telnetPort=3658` in `arthas.properties`. - `./as3.sh --telnet-port 9999` command line configuration will overwrite the default value `arthas.telnetPort=3658` in `arthas.properties`.
- If the application itself sets system properties `arthas.telnetPort=8888`, it will override the default value `arthas.telnetPort=3658` in `arthas.properties`. - If the application itself sets system properties `arthas.telnetPort=8888`, it will override the default value `arthas.telnetPort=3658` in `arthas.properties`.
If you want `arthas.properties` to have the highest order, you can configure `arthas.config.overrideAll=true`. If you want `arthas.properties` to have the highest order, you can configure `arthas.config.overrideAll=true`.

@ -1,6 +1,6 @@
# Arthas Async Jobs # Arthas Async Jobs
[`Async Jobs` online tutorial](https://arthas.aliyun.com/doc/arthas-tutorials?language=en&id=case-async-jobs) [`Async Jobs` online tutorial](https://arthas.aliyun.com/3.x/doc/arthas-tutorials?language=en&id=case-async-jobs)
Asynchronous jobs in arthas. The idea is borrowed from [linux jobs](http://man7.org/linux/man-pages/man1/jobs.1p.html). Asynchronous jobs in arthas. The idea is borrowed from [linux jobs](http://man7.org/linux/man-pages/man1/jobs.1p.html).

@ -9,7 +9,7 @@ Authenticates the current session
When attaching, you can specify a password on the command line. such as: When attaching, you can specify a password on the command line. such as:
``` ```
java -jar arthas-boot.jar --password ppp java -jar arthas-boot3.jar --password ppp
``` ```
- The user can be specified by the `--username` option, the default value is `arthas`. - The user can be specified by the `--username` option, the default value is `arthas`.

@ -30,13 +30,13 @@ Note:
Use `-f` to specify the script file. By default the result will be output to the standard output, but you can redirect the output to the file like this: Use `-f` to specify the script file. By default the result will be output to the standard output, but you can redirect the output to the file like this:
```bash ```bash
./as.sh -f /var/tmp/test.as 56328 > test.out ./as3.sh -f /var/tmp/test.as 56328 > test.out
``` ```
Use `-c` also can specify the commands, like this: Use `-c` also can specify the commands, like this:
```bash ```bash
./as.sh -c 'sysprop; thread' 56328 > test.out ./as3.sh -c 'sysprop; thread' 56328 > test.out
``` ```
### Step 3: Check the output ### Step 3: Check the output

@ -1,6 +1,6 @@
# cat # cat
[`cat` online tutorial](https://arthas.aliyun.com/doc/arthas-tutorials.html?language=en&id=command-cat) [`cat` online tutorial](https://arthas.aliyun.com/3.x/doc/arthas-tutorials.html?language=en&id=command-cat)
::: tip ::: tip
Concatenate and print files Concatenate and print files

@ -1,6 +1,6 @@
# classloader # classloader
[`classloader` online tutorial](https://arthas.aliyun.com/doc/arthas-tutorials?language=en&id=command-classloader) [`classloader` online tutorial](https://arthas.aliyun.com/3.x/doc/arthas-tutorials?language=en&id=command-classloader)
::: tip ::: tip
View hierarchy, urls and classes-loading info for the class-loaders. View hierarchy, urls and classes-loading info for the class-loaders.

@ -1,6 +1,6 @@
# dashboard # dashboard
[`dashboard` online tutorial](https://arthas.aliyun.com/doc/arthas-tutorials.html?language=en&id=command-dashboard) [`dashboard` online tutorial](https://arthas.aliyun.com/3.x/doc/arthas-tutorials.html?language=en&id=command-dashboard)
::: tip ::: tip
This is the real time statistics dashboard for the current system, press `Ctrl+C` to exit. This is the real time statistics dashboard for the current system, press `Ctrl+C` to exit.

@ -67,10 +67,10 @@ RUN export JAVA_HOME
$ docker run --name math-game -it hengyunabc/arthas:latest /bin/sh -c "java -jar /opt/arthas/math-game.jar" $ docker run --name math-game -it hengyunabc/arthas:latest /bin/sh -c "java -jar /opt/arthas/math-game.jar"
``` ```
1. Start `arthas-boot` for diagnosis 1. Start `arthas-boot3` for diagnosis
```sh ```sh
$ docker exec -it math-game /bin/sh -c "java -jar /opt/arthas/arthas-boot.jar" $ docker exec -it math-game /bin/sh -c "java -jar /opt/arthas/arthas-boot3.jar"
* [1]: 9 jar * [1]: 9 jar
[INFO] arthas home: /opt/arthas [INFO] arthas home: /opt/arthas
@ -84,7 +84,7 @@ RUN export JAVA_HOME
`--' `--'`--' '--' `--' `--' `--'`--' `--'`-----' `--' `--'`--' '--' `--' `--' `--'`--' `--'`-----'
wiki: https://arthas.aliyun.com/doc wiki: https://arthas.aliyun.com/3.x/doc
version: 3.0.5 version: 3.0.5
pid: 9 pid: 9
time: 2018-12-18 11:30:36 time: 2018-12-18 11:30:36
@ -93,13 +93,13 @@ RUN export JAVA_HOME
## Diagnose the Java process in Docker ## Diagnose the Java process in Docker
```sh ```sh
docker exec -it ${containerId} /bin/bash -c "wget https://arthas.aliyun.com/arthas-boot.jar && java -jar arthas-boot.jar" docker exec -it ${containerId} /bin/bash -c "wget https://arthas.aliyun.com/arthas-boot3.jar && java -jar arthas-boot3.jar"
``` ```
## Diagnose the Java process in the container in k8s ## Diagnose the Java process in the container in k8s
```sh ```sh
kubectl exec -it ${pod} --container ${containerId} -- /bin/bash -c "wget https://arthas.aliyun.com/arthas-boot.jar && java -jar arthas-boot.jar" kubectl exec -it ${pod} --container ${containerId} -- /bin/bash -c "wget https://arthas.aliyun.com/arthas-boot3.jar && java -jar arthas-boot3.jar"
``` ```
## Install Arthas into the base Docker image ## Install Arthas into the base Docker image

@ -2,42 +2,34 @@
## Download full package ## Download full package
### Download from maven central
Latest Version, Click To Download: [![](https://img.shields.io/maven-central/v/com.taobao.arthas/arthas-packaging.svg?style=flat-square "Arthas")](https://arthas.aliyun.com/download/latest_version)
### Download from Github Releases ### Download from Github Releases
[https://github.com/alibaba/arthas/releases](https://github.com/alibaba/arthas/releases) [https://github.com/alibaba/arthas/releases](https://github.com/alibaba/arthas/releases)
### Use as.sh ### Use as3.sh
Download and unzip, find `as.sh` in the directory. Start it in bash: Download and unzip, find `as3.sh` in the directory. Start it in bash:
```bash ```bash
./as.sh ./as3.sh
``` ```
Print usage: Print usage:
```bash ```bash
./as.sh -h ./as3.sh -h
``` ```
### Use arthas-boot.jar ### Use arthas-boot3.jar
Download and unzip, find `arthas-boot.jar` in the directory. Start with `java` command: Download and unzip, find `arthas-boot3.jar` in the directory. Start with `java` command:
```bash ```bash
java -jar arthas-boot.jar java -jar arthas-boot3.jar
``` ```
Print usage: Print usage:
```bash ```bash
java -jar arthas-boot.jar -h java -jar arthas-boot3.jar -h
``` ```
## Download Offline Help Documentation
Latest Version Documentation, Click To Download:[![](https://img.shields.io/maven-central/v/com.taobao.arthas/arthas-packaging.svg?style=flat-square "Arthas")](https://arthas.aliyun.com/download/doc/latest_version)

@ -1,6 +1,6 @@
# dump # dump
[`dump` online tutorial](https://arthas.aliyun.com/doc/arthas-tutorials?language=en&id=command-dump) [`dump` online tutorial](https://arthas.aliyun.com/3.x/doc/arthas-tutorials?language=en&id=command-dump)
::: tip ::: tip
Dump the bytecode for the particular classes to the specified directory. Dump the bytecode for the particular classes to the specified directory.

@ -1,6 +1,6 @@
# echo # echo
[`echo` online tutorial](https://arthas.aliyun.com/doc/arthas-tutorials.html?language=en&id=command-echo) [`echo` online tutorial](https://arthas.aliyun.com/3.x/doc/arthas-tutorials.html?language=en&id=command-echo)
::: tip ::: tip
write arguments to the standard output. write arguments to the standard output.

@ -106,6 +106,6 @@ Reference: [https://github.com/alibaba/arthas/issues/362#issuecomment-448185416]
### Why is the new version of Arthas downloaded, but the old version is connected? ### Why is the new version of Arthas downloaded, but the old version is connected?
For example, the started version of `as.sh/arthas-boot.jar` is 3.5._, but after connecting, the printed arthas version is 3.4._. For example, the started version of `as3.sh/arthas-boot3.jar` is 3.5._, but after connecting, the printed arthas version is 3.4._.
It may be that the target process has been diagnosed with the old version of arthas before. You can execute `stop` to stop the old version of arthas, and then reuse the new version to attach. It may be that the target process has been diagnosed with the old version of arthas before. You can execute `stop` to stop the old version of arthas, and then reuse the new version to attach.

@ -1,6 +1,6 @@
# getstatic # getstatic
[`getstatic` online tutorial](https://arthas.aliyun.com/doc/arthas-tutorials.html?language=en&id=command-getstatic) [`getstatic` online tutorial](https://arthas.aliyun.com/3.x/doc/arthas-tutorials.html?language=en&id=command-getstatic)
## Usage ## Usage

@ -1,6 +1,6 @@
# grep # grep
[`grep` online tutorial](https://arthas.aliyun.com/doc/arthas-tutorials.html?language=en&id=command-grep) [`grep` online tutorial](https://arthas.aliyun.com/3.x/doc/arthas-tutorials.html?language=en&id=command-grep)
::: tip ::: tip
Similar to the traditional `grep` command. Similar to the traditional `grep` command.
@ -24,7 +24,7 @@ Similar to the traditional `grep` command.
thread | grep -m 10 -e "TIMED_WAITING|WAITING" thread | grep -m 10 -e "TIMED_WAITING|WAITING"
WIKI: WIKI:
https://arthas.aliyun.com/doc/grep https://arthas.aliyun.com/3.x/doc/grep
OPTIONS: OPTIONS:
-A, --after-context <value> Print NUM lines of trailing context) -A, --after-context <value> Print NUM lines of trailing context)

@ -1,6 +1,6 @@
# heapdump # heapdump
[`heapdump` online tutorial](https://arthas.aliyun.com/doc/arthas-tutorials.html?language=en&id=command-heapdump) [`heapdump` online tutorial](https://arthas.aliyun.com/3.x/doc/arthas-tutorials.html?language=en&id=command-heapdump)
::: tip ::: tip
dump java heap in hprof binary format, like `jmap`. dump java heap in hprof binary format, like `jmap`.

@ -78,7 +78,7 @@ $ help
dashboard -i 2000 dashboard -i 2000
WIKI: WIKI:
https://arthas.aliyun.com/doc/dashboard https://arthas.aliyun.com/3.x/doc/dashboard
OPTIONS: OPTIONS:
-h, --help this help -h, --help this help

@ -1,6 +1,6 @@
# Http API # Http API
[`Http API` online tutorial](https://arthas.aliyun.com/doc/arthas-tutorials.html?language=en&id=case-http-api) [`Http API` online tutorial](https://arthas.aliyun.com/3.x/doc/arthas-tutorials.html?language=en&id=case-http-api)
## Overview ## Overview
@ -301,12 +301,12 @@ The response content is as follows:
"message": "Welcome to arthas!" "message": "Welcome to arthas!"
}, },
{ {
"tutorials": "https://arthas.aliyun.com/doc/arthas-tutorials.html", "tutorials": "https://arthas.aliyun.com/3.x/doc/arthas-tutorials.html",
"time": "2020-08-06 15:56:43", "time": "2020-08-06 15:56:43",
"type": "welcome", "type": "welcome",
"jobId": 0, "jobId": 0,
"pid": "7909", "pid": "7909",
"wiki": "https://arthas.aliyun.com/doc", "wiki": "https://arthas.aliyun.com/3.x/doc",
"version": "3.3.7" "version": "3.3.7"
}, },
{ {

@ -2,47 +2,49 @@
## Quick installation ## Quick installation
### Use `arthas-boot`(Recommended) ### Use `arthas-boot3`(Recommended)
Download`arthas-boot.jar`Start with `java` command: Download`arthas-boot3.jar`Start with `java` command:
```bash ```bash
curl -O https://arthas.aliyun.com/arthas-boot.jar curl -O https://arthas.aliyun.com/arthas-boot3.jar
java -jar arthas-boot.jar java -jar arthas-boot3.jar
``` ```
Print usage: Print usage:
```bash ```bash
java -jar arthas-boot.jar -h java -jar arthas-boot3.jar -h
``` ```
### Use `as.sh` ### Use `as3.sh`
You can install Arthas with one single line command on Linux, Unix, and Mac. Pls. copy the following command and paste it into the command line, then press _Enter_ to run: You can install Arthas with one single line command on Linux, Unix, and Mac. Pls. copy the following command and paste it into the command line, then press _Enter_ to run:
```bash ```bash
curl -L https://arthas.aliyun.com/install.sh | sh curl -L https://arthas.aliyun.com/install3.sh | sh
``` ```
The command above will download the bootstrap script `as.sh` to the current directory. You can move it to any other place you want, or put its location in `$PATH`. The command above will download the bootstrap script `as3.sh` to the current directory. You can move it to any other place you want, or put its location in `$PATH`.
You can enter its interactive interface by executing `as.sh`, or execute `as.sh -h` for more help information. You can enter its interactive interface by executing `as3.sh`, or execute `as3.sh -h` for more help information.
## Full installation ## Full installation
Latest Version, Click To Download: [![](https://img.shields.io/maven-central/v/com.taobao.arthas/arthas-packaging.svg?style=flat-square "Arthas")](https://arthas.aliyun.com/download/latest_version) Download from Github Releases
Download and unzip, find `arthas-boot.jar` in the directory. Start with `java` command: [https://github.com/alibaba/arthas/releases](https://github.com/alibaba/arthas/releases)
Download and unzip, find `arthas-boot3.jar` in the directory. Start with `java` command:
```bash ```bash
java -jar arthas-boot.jar java -jar arthas-boot3.jar
``` ```
Print usage: Print usage:
```bash ```bash
java -jar arthas-boot.jar -h java -jar arthas-boot3.jar -h
``` ```
## Manual Installation ## Manual Installation
@ -71,7 +73,7 @@ sudo rpm -i arthas*.rpm
After the installation of packages, execute After the installation of packages, execute
```bash ```bash
as.sh as3.sh
``` ```
## Offline Help Documentation ## Offline Help Documentation

@ -1,6 +1,6 @@
# jad # jad
[`jad` online tutorial](https://arthas.aliyun.com/doc/arthas-tutorials?language=en&id=command-jad) [`jad` online tutorial](https://arthas.aliyun.com/3.x/doc/arthas-tutorials?language=en&id=command-jad)
::: tip ::: tip
Decompile the specified classes. Decompile the specified classes.

@ -1,6 +1,6 @@
# jfr # jfr
[`jfr` online tutorial](https://arthas.aliyun.com/doc/arthas-tutorials.html?language=en&id=command-jfr) [`jfr` online tutorial](https://arthas.aliyun.com/3.x/doc/arthas-tutorials.html?language=en&id=command-jfr)
::: tip ::: tip
Java Flight Recorder (JFR) is a tool for collecting diagnostic and profiling data about a running Java application. It is integrated into the Java Virtual Machine (JVM) and causes almost no performance overhead, so it can be used even in heavily loaded production environments. Java Flight Recorder (JFR) is a tool for collecting diagnostic and profiling data about a running Java application. It is integrated into the Java Virtual Machine (JVM) and causes almost no performance overhead, so it can be used even in heavily loaded production environments.

@ -1,6 +1,6 @@
# jvm # jvm
[`jvm` online tutorial](https://arthas.aliyun.com/doc/arthas-tutorials.html?language=en&id=command-jvm) [`jvm` online tutorial](https://arthas.aliyun.com/3.x/doc/arthas-tutorials.html?language=en&id=command-jvm)
::: tip ::: tip
Check the current JVM's info Check the current JVM's info

@ -1,6 +1,6 @@
# keymap # keymap
[`keymap` online tutorial](https://arthas.aliyun.com/doc/arthas-tutorials.html?language=en&id=command-keymap) [`keymap` online tutorial](https://arthas.aliyun.com/3.x/doc/arthas-tutorials.html?language=en&id=command-keymap)
Use `keymap` command to print the current keymap: Use `keymap` command to print the current keymap:

@ -1,6 +1,6 @@
# logger # logger
[`logger` online tutorial](https://arthas.aliyun.com/doc/arthas-tutorials?language=en&id=command-logger) [`logger` online tutorial](https://arthas.aliyun.com/3.x/doc/arthas-tutorials?language=en&id=command-logger)
::: tip ::: tip
Print the logger information, update the logger level Print the logger information, update the logger level

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save