You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
arthas/en/_sources/start-arthas.md.txt

73 lines
1.9 KiB
Plaintext

6 years ago
Start Arthas
=====
## Interactive Mode
```bash
./as.sh
```
6 years ago
```bash
6 years ago
➜ bin git:(develop) ✗ ./as.sh
Found existing java process, please choose one and hit RETURN.
[1]: 3088 org.jetbrains.idea.maven.server.RemoteMavenServer
* [2]: 12872 org.apache.catalina.startup.Bootstrap
[3]: 2455
Attaching to 12872...
,---. ,------. ,--------.,--. ,--. ,---. ,---.
/ O \ | .--. ''--. .--'| '--' | / O \ ' .-'
| .-. || '--'.' | | | .--. || .-. |`. `-.
| | | || |\ \ | | | | | || | | |.-' |
`--' `--'`--' '--' `--' `--' `--'`--' `--'`-----'
$
```
## Non-Interactive Mode
Startup script is as follows:
```bash
./as.sh <PID>[@IP:PORT]
```
### Parameter Description
6 years ago
* *PID*: Target Java process ID (Make sure that the user executing the command has sufficient permissions to operate the target Java process.)
* *IP*: The address that Arthas Server listens on, the default value is `127.0.0.1`. Arthas allows multiple users to access simultaneously without interfering with each other.
* *PORT*: Arthas Server portthe default value is 3658
6 years ago
### Sample
6 years ago
* If IP and PORT are not specified, then the default values are 127.0.0.1 and 3658
6 years ago
> ./as.sh 12345
Equivalent to:
> ./as.sh 12356@127.0.0.1:3658
### Remote Diagnosis
6 years ago
After starting Arthas Server on the target Java process, users can use `telnet` connect to the remote Arthas Server, for example
6 years ago
```bash
telnet 192.168.1.119 3658
```
### sudo Support
6 years ago
Usually online environment will only grant users privilege as low as possible, instead, all advanced operations are through sudo-list. Since `as.sh` script takes into account the current effective user, it is possible to run the script in the other rule, by specifying `-H` option like this:
6 years ago
```bash
sudo -u admin -H ./as.sh 12345
```
### Windows Support
6 years ago
Right now `as.bat` script supports one parameter only, which is: pid
6 years ago
```bash
as.bat <pid>
6 years ago
```