@ -32,23 +32,23 @@ Recommend to use [`as-package.sh`](as-package.sh) to package, which will auto-in
* windows need to install gcc
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`.
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
When there are several different version, you can use `--use-version` to specify the version of Arthas to start your debug.
```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.
```bash
./as.sh --versions
./as3.sh --versions
```
### Debug
@ -97,22 +97,22 @@ Tip: you can use `--versions` to list all available versions.
[![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")
@ -43,55 +43,52 @@ Arthas was built to solve these issues. A developer can troubleshoot your produc
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
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.
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.
[![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")
@ -29,73 +29,70 @@ English version goes [here](README.md).
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"2. Try to use different http port, for example: as.sh --telnet-port 9998 --http-port 9999"
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: as3.sh --telnet-port 9998 --http-port 9999"
exit1
fi
elif[ -z ${TARGET_PID}];then
@ -931,8 +931,8 @@ sanity_check() {
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"To solve this, choose one of the following command:"
echo" 1) sudo su $target_user && ./as.sh"
echo" 2) sudo -u $target_user -EH ./as.sh"
echo" 1) sudo su $target_user && ./as3.sh"
echo" 2) sudo -u $target_user -EH ./as3.sh"
exit_on_err 1
fi
}
@ -972,15 +972,15 @@ port_pid_check() {
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] 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] 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(){
localerror_msg=$1
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"
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/)。
@ -56,7 +56,7 @@ The order of configuration is: command line parameters > System Env > System Pro
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 you want `arthas.properties` to have the highest order, you can configure `arthas.config.overrideAll=true`.
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
./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:
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
./as.sh
./as3.sh
```
Print usage:
```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
java -jar arthas-boot.jar
java -jar arthas-boot3.jar
```
Print usage:
```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)
### 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.
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://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
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:
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.