From 57116129464eced15f9adc39443ee8f90f96cb51 Mon Sep 17 00:00:00 2001 From: hengyunabc Date: Thu, 29 Nov 2018 16:16:20 +0800 Subject: [PATCH] update install-detail.md manual-install.md --- site/src/site/sphinx/en/install-detail.md | 66 ++++++--------------- site/src/site/sphinx/en/manual-install.md | 69 ++++++++++++++++++++++ site/src/site/sphinx/install-detail.md | 65 ++++++--------------- site/src/site/sphinx/manual-install.md | 71 ++++++++++++++++++++++- 4 files changed, 174 insertions(+), 97 deletions(-) diff --git a/site/src/site/sphinx/en/install-detail.md b/site/src/site/sphinx/en/install-detail.md index cf0beb9d2fc..f47f5f12455 100644 --- a/site/src/site/sphinx/en/install-detail.md +++ b/site/src/site/sphinx/en/install-detail.md @@ -1,24 +1,26 @@ Install Arthas ============== -## All Platform (recommended) +## Quick installation -Latest Version, Click To Download: [![Arthas](https://img.shields.io/maven-central/v/com.taobao.arthas/arthas-packaging.svg?style=flat-square "Arthas")](http://repository.sonatype.org/service/local/artifact/maven/redirect?r=central-proxy&g=com.taobao.arthas&a=arthas-packaging&e=zip&c=bin&v=LATEST) -Download and unzip, find `arthas-boot.jar` in the directory. Start with `java` command: +### Use `arthas-boot` + +Download`arthas-boot.jar`,Start with `java` command: ```bash +wget https://alibaba.github.io/arthas/arthas-boot.jar java -jar arthas-boot.jar ``` -Print help information: +Print usage: ```bash java -jar arthas-boot.jar -h ``` -## Linux/Unix/Mac +### Use `as.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: @@ -30,59 +32,27 @@ The command above will download the bootstrap script `as.sh` to the current dire You can enter its interactive interface by executing `as.sh`, or execute `as.sh -h` for more help information. -## Windows + +## Full installation Latest Version, Click To Download: [![Arthas](https://img.shields.io/maven-central/v/com.taobao.arthas/arthas-packaging.svg?style=flat-square "Arthas")](http://repository.sonatype.org/service/local/artifact/maven/redirect?r=central-proxy&g=com.taobao.arthas&a=arthas-packaging&e=zip&c=bin&v=LATEST) -Download and unzip, then find `as.bat` from 'bin' directory. For now this script will only take one argument `pid`, which means you can only diagnose the local Java process. (Welcome any bat script expert to make it better :heart:) +Download and unzip, find `arthas-boot.jar` in the directory. Start with `java` command: ```bash -as.bat +java -jar arthas-boot.jar ``` -## Manual Installation - -[Manual Installation](manual-install.md) - -If you fail to boot Arthas with the provided batch file, you could try to assemble the bootstrap command in the following way. - - -1. Locate java in the target JVM: +Print usage: - - Linux/Unix/Mac: `ps aux | grep java` - - Windows: open the Process Monitor to search java - -2. Assemble bootstrap command: - - Let's suppose we are using `/opt/jdk1.8/bin/java`, then the command should be: - - ```bash - /opt/jdk1.8/bin/java -Xbootclasspath/a:/opt/jdk1.8/lib/tools.jar \ - -jar /tmp/arthas-packaging/arthas-core.jar \ - -pid 15146 \ - -target-ip 127.0.0.1 -telnet-port 3658 -http-port 8563 \ - -core /tmp/arthas-packaging/arthas-core.jar \ - -agent /tmp/arthas-packaging/arthas/arthas-agent.jar - ``` - - Note: - - * `-Xbootclasspath` adds tools.jar - * `-jar /tmp/arthas-packaging/arthas-core.jar` specifies main entry - * `-pid 15146` specifies the target java process PID - * `-target-ip 127.0.0.1` specifies the IP - * `-telnet-port 3658 -http-port 8563` specifies telnet and HTTP ports for remote access - * `-core /tmp/arthas-packaging/arthas-core.jar -agent /tmp/arthas-packaging/arthas/arthas-agent.jar` specifies core/agent jar package +```bash +java -jar arthas-boot.jar -h +``` - If you are running on JDK 1.9 or above,then it's unncessary to add `tools.jar` in option `-Xbootclasspath`. - - You can find the logs from `~/logs/arthas/arthas.log`. +## Manual Installation -3. Use telnet to connect once attaching to the target JVM (in step 2) succeeds +[Manual Installation](manual-install.md) - ```bash - telnet 127.0.0.1 3658 - ``` ## Offline Help Documentation @@ -97,4 +67,4 @@ Latest Version, Click To Download:[![Arthas](https://img.shields.io/maven-centra rm -rf ~/.arthas/ ``` -* On Windows, simply delete the zip file and unzipped files. +* On Windows, delete `.arthas` directory under user home. diff --git a/site/src/site/sphinx/en/manual-install.md b/site/src/site/sphinx/en/manual-install.md index 6177e1803fd..481b9929c08 100644 --- a/site/src/site/sphinx/en/manual-install.md +++ b/site/src/site/sphinx/en/manual-install.md @@ -1,6 +1,8 @@ Manually Install Arthas =================== +## Manually Install Arthas + 1. Download the latest version **Latest version, Click To Download**: [![Arthas](https://img.shields.io/maven-central/v/com.taobao.arthas/arthas-packaging.svg?style=flat-square "Arthas")](http://repository.sonatype.org/service/local/artifact/maven/redirect?r=central-proxy&g=com.taobao.arthas&a=arthas-packaging&e=zip&c=bin&v=LATEST) @@ -31,3 +33,70 @@ Manually Install Arthas ```bash ./as.sh ``` + + +## Startup with as.sh/as.bat + +### Linux/Unix/Mac + +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 +curl -L https://alibaba.github.io/arthas/install.sh | sh +``` + +The command above will download the bootstrap script `as.sh` to the current directory. You can move it the 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. + +### Windows + +Latest Version, Click To Download: [![Arthas](https://img.shields.io/maven-central/v/com.taobao.arthas/arthas-packaging.svg?style=flat-square "Arthas")](http://repository.sonatype.org/service/local/artifact/maven/redirect?r=central-proxy&g=com.taobao.arthas&a=arthas-packaging&e=zip&c=bin&v=LATEST) + +Download and unzip, then find `as.bat` from 'bin' directory. For now this script will only take one argument `pid`, which means you can only diagnose the local Java process. (Welcome any bat script expert to make it better :heart:) + +```bash +as.bat +``` + +## Manual command line startup + +If you fail to boot Arthas with the provided batch file, you could try to assemble the bootstrap command in the following way. + + +1. Locate java in the target JVM: + + - Linux/Unix/Mac: `ps aux | grep java` + - Windows: open the Process Monitor to search java + +2. Assemble bootstrap command: + + Let's suppose we are using `/opt/jdk1.8/bin/java`, then the command should be: + + ```bash + /opt/jdk1.8/bin/java -Xbootclasspath/a:/opt/jdk1.8/lib/tools.jar \ + -jar /tmp/arthas-packaging/arthas-core.jar \ + -pid 15146 \ + -target-ip 127.0.0.1 -telnet-port 3658 -http-port 8563 \ + -core /tmp/arthas-packaging/arthas-core.jar \ + -agent /tmp/arthas-packaging/arthas/arthas-agent.jar + ``` + + Note: + + * `-Xbootclasspath` adds tools.jar + * `-jar /tmp/arthas-packaging/arthas-core.jar` specifies main entry + * `-pid 15146` specifies the target java process PID + * `-target-ip 127.0.0.1` specifies the IP + * `-telnet-port 3658 -http-port 8563` specifies telnet and HTTP ports for remote access + * `-core /tmp/arthas-packaging/arthas-core.jar -agent /tmp/arthas-packaging/arthas/arthas-agent.jar` specifies core/agent jar package + + If you are running on JDK 1.9 or above,then it's unncessary to add `tools.jar` in option `-Xbootclasspath`. + + You can find the logs from `~/logs/arthas/arthas.log`. + +3. Use telnet to connect once attaching to the target JVM (in step 2) succeeds + + ```bash + telnet 127.0.0.1 3658 + ``` \ No newline at end of file diff --git a/site/src/site/sphinx/install-detail.md b/site/src/site/sphinx/install-detail.md index 05cd6953d2b..b063491881e 100644 --- a/site/src/site/sphinx/install-detail.md +++ b/site/src/site/sphinx/install-detail.md @@ -1,14 +1,14 @@ Arthas Install ============= +## 快速安装 -## 全平台通用(推荐) +### 使用`arthas-boot` -最新版本,点击下载:[![Arthas](https://img.shields.io/maven-central/v/com.taobao.arthas/arthas-packaging.svg?style=flat-square "Arthas")](http://repository.sonatype.org/service/local/artifact/maven/redirect?r=central-proxy&g=com.taobao.arthas&a=arthas-packaging&e=zip&c=bin&v=LATEST) - -解压后,在文件夹里有`arthas-boot.jar`,直接用`java -jar`的方式启动: +下载`arthas-boot.jar`,然后用`java -jar`的方式启动: ```bash +wget https://alibaba.github.io/arthas/arthas-boot.jar java -jar arthas-boot.jar ``` @@ -18,8 +18,9 @@ java -jar arthas-boot.jar java -jar arthas-boot.jar -h ``` +* 如果下载速度比较慢,可以使用aliyun的镜像:`java -jar arthas-boot.jar --repo-mirror aliyun --use-http` -## Linux/Unix/Mac +### 使用`as.sh` Arthas 支持在 Linux/Unix/Mac 等平台上一键安装,请复制以下内容,并粘贴到命令行中,敲 `回车` 执行即可: @@ -33,58 +34,26 @@ curl -L https://alibaba.github.io/arthas/install.sh | sh 也可以执行`./as.sh -h`来获取更多参数信息。 - -## Windows +## 全量安装 最新版本,点击下载:[![Arthas](https://img.shields.io/maven-central/v/com.taobao.arthas/arthas-packaging.svg?style=flat-square "Arthas")](http://repository.sonatype.org/service/local/artifact/maven/redirect?r=central-proxy&g=com.taobao.arthas&a=arthas-packaging&e=zip&c=bin&v=LATEST) +解压后,在文件夹里有`arthas-boot.jar`,直接用`java -jar`的方式启动: -下载解压后在bin目录有 `as.bat`。此脚本暂时只接受一个参数 pid,即只能诊断本机上的 Java 进程。(欢迎精通bat脚本的开发者改进) - -``` -as.bat +```bash +java -jar arthas-boot.jar ``` -## 手动安装 - -[手动安装](manual-install.md) - -## 手动拼接命令行启动 - -如果启动遇到问题,可以尝试手动拼接出命令行参数来启动。 - -1. 查找目录jvm的java文件路径。 - - 在linux/mac上执行`ps aux | grep java`,在windows上可以通过进程管理器来查看。假设是`/opt/jdk1.8/bin/java`。 - -2. 拼接出命令行 - - ```bash - /opt/jdk1.8/bin/java -Xbootclasspath/a:/opt/jdk1.8/lib/tools.jar \ - -jar /tmp/arthas-packaging/arthas-core.jar \ - -pid 15146 \ - -target-ip 127.0.0.1 -telnet-port 3658 -http-port 8563 \ - -core /tmp/arthas-packaging/arthas-core.jar \ - -agent /tmp/arthas-packaging/arthas/arthas-agent.jar - ``` - 命令行分几部分组成: - - * `-Xbootclasspath` 增加tools.jar - * `-jar /tmp/arthas-packaging/arthas-core.jar` 指定main函数入口 - * `-pid 15146` 指定目标java进程ID - * `-target-ip 127.0.0.1` 指定IP - * `-telnet-port 3658 -http-port 8563` 指定telnet和http端口 - * `-core /tmp/arthas-packaging/arthas-core.jar -agent /tmp/arthas-packaging/arthas/arthas-agent.jar` 指定core/agent jar包 +打印帮助信息: - 如果是`jdk > 9`,即9/10/11以上的版本,不需要指定`tools.jar`,直接去掉`-Xbootclasspath` 的配置即可。 +```bash +java -jar arthas-boot.jar -h +``` - 启动目志输出在`~/logs/arthas/arthas.log`里。 -3. attach成功之后,使用telnet连接 - ```bash - telnet 127.0.0.1 3658 - ``` +## 手动安装 +[手动安装](manual-install.md) ## 离线帮助文档 @@ -100,4 +69,4 @@ as.bat rm -rf ~/.arthas/ ``` -* Windows平台直接删除zip包和解压的文件 +* Windows平台直接删除user home下面的`.arthas`目录 diff --git a/site/src/site/sphinx/manual-install.md b/site/src/site/sphinx/manual-install.md index 0687381db38..41ae31c34b7 100644 --- a/site/src/site/sphinx/manual-install.md +++ b/site/src/site/sphinx/manual-install.md @@ -1,6 +1,9 @@ 手动安装Arthas === +## 手动安装Arthas + + 1. 下载最新版本 **最新版本,点击下载**:[![Arthas](https://img.shields.io/maven-central/v/com.taobao.arthas/arthas-packaging.svg?style=flat-square "Arthas")](http://repository.sonatype.org/service/local/artifact/maven/redirect?r=central-proxy&g=com.taobao.arthas&a=arthas-packaging&e=zip&c=bin&v=LATEST) @@ -34,4 +37,70 @@ ``` ./as.sh - ``` \ No newline at end of file + ``` + +## 以脚本的方式启动as.sh/as.bat + +### Linux/Unix/Mac + +Arthas 支持在 Linux/Unix/Mac 等平台上一键安装,请复制以下内容,并粘贴到命令行中,敲 `回车` 执行即可: + +```bash +curl -L https://alibaba.github.io/arthas/install.sh | sh +``` + +上述命令会下载启动脚本文件 `as.sh` 到当前目录,你可以放在任何地方或将其加入到 `$PATH` 中。 + +直接在shell下面执行`./as.sh`,就会进入交互界面。 + +也可以执行`./as.sh -h`来获取更多参数信息。 + + +### Windows + +最新版本,点击下载:[![Arthas](https://img.shields.io/maven-central/v/com.taobao.arthas/arthas-packaging.svg?style=flat-square "Arthas")](http://repository.sonatype.org/service/local/artifact/maven/redirect?r=central-proxy&g=com.taobao.arthas&a=arthas-packaging&e=zip&c=bin&v=LATEST) + + +下载解压后在bin目录有 `as.bat`。此脚本暂时只接受一个参数 pid,即只能诊断本机上的 Java 进程。(欢迎精通bat脚本的开发者改进) + +``` +as.bat +``` + +## 手动拼接命令行启动 + +如果启动遇到问题,可以尝试手动拼接出命令行参数来启动。 + +1. 查找目录jvm的java文件路径。 + + 在linux/mac上执行`ps aux | grep java`,在windows上可以通过进程管理器来查看。假设是`/opt/jdk1.8/bin/java`。 + +2. 拼接出命令行 + + ```bash + /opt/jdk1.8/bin/java -Xbootclasspath/a:/opt/jdk1.8/lib/tools.jar \ + -jar /tmp/arthas-packaging/arthas-core.jar \ + -pid 15146 \ + -target-ip 127.0.0.1 -telnet-port 3658 -http-port 8563 \ + -core /tmp/arthas-packaging/arthas-core.jar \ + -agent /tmp/arthas-packaging/arthas/arthas-agent.jar + ``` + 命令行分几部分组成: + + * `-Xbootclasspath` 增加tools.jar + * `-jar /tmp/arthas-packaging/arthas-core.jar` 指定main函数入口 + * `-pid 15146` 指定目标java进程ID + * `-target-ip 127.0.0.1` 指定IP + * `-telnet-port 3658 -http-port 8563` 指定telnet和http端口 + * `-core /tmp/arthas-packaging/arthas-core.jar -agent /tmp/arthas-packaging/arthas/arthas-agent.jar` 指定core/agent jar包 + + 如果是`jdk > 9`,即9/10/11以上的版本,不需要指定`tools.jar`,直接去掉`-Xbootclasspath` 的配置即可。 + + 启动目志输出在`~/logs/arthas/arthas.log`里。 +3. attach成功之后,使用telnet连接 + + ```bash + telnet 127.0.0.1 3658 + ``` + +