update doc 3.1.2

This commit is contained in:
hengyunabc committed 2019-09-09 14:49:55 +08:00
1 parent 1afcb5035d
commit 39091052c1
206 files changed
+8994 -6117

No files matched your search

+5 -2
View File
@@ -22,9 +22,12 @@ Advanced Usage
* [jvm](jvm.md) - show JVM information
* [sysprop](sysprop.md) - view/modify system properties
* [sysenv](sysenv.md) — view system environment variables
* [vmoption](vmoption.md) - view/modify the vm diagnostic options.
* [logger](logger.md) - print the logger information, update the logger level
* [getstatic](getstatic.md) - examine class's static properties
* **New!** [ognl](ognl.md) - execute ongl expression
* **New!** [mbean](mbean.md) - show Mbean information
* [ognl](ognl.md) - execute ongl expression
* [mbean](mbean.md) - show Mbean information
* [heapdump](heapdump.md) - dump java heap in hprof binary format, like `jmap`
## class/classloader
+4
View File
@@ -6,6 +6,8 @@ All Commands
* [jvm](jvm.md)
* [sysprop](sysprop.md)
* [sysenv](sysenv.md)
* [vmoption](vmoption.md)
* [logger](logger.md)
* [mbean](mbean.md)
* [getstatic](getstatic.md)
@@ -14,6 +16,7 @@ All Commands
* [sc](sc.md)
* [sm](sm.md)
* [dump](dump.md)
* [heapdump](heapdump.md)
* [jad](jad.md)
* [classloader](classloader.md)
@@ -40,6 +43,7 @@ All Commands
* version - print out Arthas's version
* history - view command history
* quit - exit the current Arthas client without affecting other clients
* stop - the same as `shutdown` command
* shutdown - terminate the Arthas server, all the Arthas clients connecting to this server will be disconnected
* [keymap](keymap.md) - list all Arthas keyboard shortcuts and shortcut customizations.
+1 -1
View File
@@ -58,4 +58,4 @@ uptime 16020s busy
### Screenshot
![alt text](../_static/dashboard.png "dashboard")
![](../_static/dashboard.png "dashboard")
+23
View File
@@ -0,0 +1,23 @@
Download
===
## Download full package
Latest Version, Click To Download: [![](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=doc&v=LATEST)
Download and unzip, find `arthas-boot.jar` in the directory. Start with `java` command:
```bash
java -jar arthas-boot.jar
```
Print usage:
```bash
java -jar arthas-boot.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")](http://repository.sonatype.org/service/local/artifact/maven/redirect?r=central-proxy&g=com.taobao.arthas&a=arthas-packaging&e=zip&c=doc&v=LATEST)
+34
View File
@@ -0,0 +1,34 @@
heapdump
===
> dump java heap in hprof binary format, like `jmap`.
### Usage
#### Dump to file
```bash
[arthas@58205]$ heapdump /tmp/dump.hprof
Dumping heap to /tmp/dump.hprof...
Heap dump file created
```
#### Dump only live objects
```bash
[arthas@58205]$ heapdump --live /tmp/dump.hprof
Dumping heap to /tmp/dump.hprof...
Heap dump file created
```
#### Dump to tmp file
```bash
[arthas@58205]$ heapdump
Dumping heap to /var/folders/my/wy7c9w9j5732xbkcyt1mb4g40000gp/T/heapdump2019-09-03-16-385121018449645518991.hprof...
Heap dump file created
```
+5 -3
View File
@@ -3,7 +3,7 @@ Arthas Documentation
**[中文文档/Chinese Documentation](https://alibaba.github.io/arthas/)**
![arthas](arthas.png)
![](arthas.png)
Arthas is a Java diagnostic tool open-sourced by Alibaba middleware team. It is widely adopted and popular among the developers inside Alibaba. Arthas helps developers in trouble-shooting issues in production environment for Java based applications without modifying code or restarting servers.
@@ -40,12 +40,14 @@ Contents
* [Online tutorials(Recommend)](https://alibaba.github.io/arthas/arthas-tutorials?language=en)
* [Installation](install-detail.md)
* [Download](download.md)
* [Quick start](quick-start.md)
* [Advanced usage](advanced-use.md)
* [Commands](commands.md)
* [WebConsole](web-console.md)
* [Docker](docker.md)
* [User cases](https://github.com/alibaba/arthas/issues?q=label%3Auser-case)
* [Questions and answers](https://github.com/alibaba/arthas/issues?q=label%3Aquestion-answered)
* [Fork me at GitHub](https://github.com/alibaba/arthas)
* [CONTRIBUTING](https://github.com/alibaba/arthas/blob/master/CONTRIBUTING.md)
* [Release Notes](release-notes.md)
* [Compile and debug/CONTRIBUTING](https://github.com/alibaba/arthas/blob/master/CONTRIBUTING.md)
* [Release Notes](https://github.com/alibaba/arthas/releases)
+27 -3
View File
@@ -28,14 +28,14 @@ You can install Arthas with one single line command on Linux, Unix, and Mac. Pls
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`.
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`.
You can enter its interactive interface by executing `as.sh`, or execute `as.sh -h` for more help information.
## 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=doc&v=LATEST)
Latest Version, Click To Download: [![](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=doc&v=LATEST)
Download and unzip, find `arthas-boot.jar` in the directory. Start with `java` command:
@@ -54,9 +54,33 @@ java -jar arthas-boot.jar -h
[Manual Installation](manual-install.md)
## Installation via Packages
Arthas has packages for Debian and Fedora based systems.
you can get them from the github releases page https://github.com/alibaba/arthas/releases.
### Instruction for Debian based systems
```bash
sudo dpkg -i arthas*.deb
```
### Instruction for Fedora based systems
```bash
sudo rpm -i arthas*.rpm
```
### Usage
After the installation of packages, execute
```bash
as.sh
```
## Offline Help Documentation
Latest Version, Click To Download:[![Arthas](https://img.shields.io/maven-central/v/com.taobao.arthas/arthas-packaging.svg?style=flat-square "Arthas")](https://github.com/alibaba/arthas/releases/download/arthas-all-3.0.5/arthas-3.0.5-doc.zip)
Latest Version Documentation, Click To Download:[![](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=doc&v=LATEST)
## Uninstall
+184
View File
@@ -0,0 +1,184 @@
logger
===
> Print the logger information, update the logger level
### Usage
#### Print the logger information
Take the following `logback.xml` as an example:
```xml
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<appender name="APPLICATION" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>app.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<fileNamePattern>mylog-%d{yyyy-MM-dd}.%i.txt</fileNamePattern>
<maxFileSize>100MB</maxFileSize>
<maxHistory>60</maxHistory>
<totalSizeCap>2GB</totalSizeCap>
</rollingPolicy>
<encoder>
<pattern>%logger{35} - %msg%n</pattern>
</encoder>
</appender>
<appender name="ASYNC" class="ch.qos.logback.classic.AsyncAppender">
<appender-ref ref="APPLICATION" />
</appender>
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%-4relative [%thread] %-5level %logger{35} - %msg %n
</pattern>
<charset>utf8</charset>
</encoder>
</appender>
<root level="INFO">
<appender-ref ref="CONSOLE" />
<appender-ref ref="ASYNC" />
</root>
</configuration>
```
The result of the `logger` command:
```bash
[arthas@2062]$ logger
name ROOT
class ch.qos.logback.classic.Logger
classLoader sun.misc.Launcher$AppClassLoader@2a139a55
classLoaderHash 2a139a55
level INFO
effectiveLevel INFO
additivity true
codeSource file:/Users/hengyunabc/.m2/repository/ch/qos/logback/logback-classic/1.2.3/logback-classic-1.2.3.jar
appenders name CONSOLE
class ch.qos.logback.core.ConsoleAppender
classLoader sun.misc.Launcher$AppClassLoader@2a139a55
classLoaderHash 2a139a55
target System.out
name APPLICATION
class ch.qos.logback.core.rolling.RollingFileAppender
classLoader sun.misc.Launcher$AppClassLoader@2a139a55
classLoaderHash 2a139a55
file app.log
name ASYNC
class ch.qos.logback.classic.AsyncAppender
classLoader sun.misc.Launcher$AppClassLoader@2a139a55
classLoaderHash 2a139a55
appenderRef [APPLICATION]
```
In the `appenders` section:
* The target of `CONSOLE` logger is `System.out`
* `APPLICATION` logger is `RollingFileAppender`, the file is `app.log`
* `ASYNC` its `appenderRef` is `APPLICATION`, which means asynchronous output to the file
#### View logger information for the special name
```bash
[arthas@2062]$ logger -n org.springframework.web
name org.springframework.web
class ch.qos.logback.classic.Logger
classLoader sun.misc.Launcher$AppClassLoader@2a139a55
classLoaderHash 2a139a55
level null
effectiveLevel INFO
additivity true
codeSource file:/Users/hengyunabc/.m2/repository/ch/qos/logback/logback-classic/1.2.3/logback-classic-1.2.3.jar
```
#### View logger information for the special classloader
```bash
[arthas@2062]$ logger -c 2a139a55
name ROOT
class ch.qos.logback.classic.Logger
classLoader sun.misc.Launcher$AppClassLoader@2a139a55
classLoaderHash 2a139a55
level DEBUG
effectiveLevel DEBUG
additivity true
codeSource file:/Users/hengyunabc/.m2/repository/ch/qos/logback/logback-classic/1.2.3/logback-classic-1.2.3.jar
appenders name CONSOLE
class ch.qos.logback.core.ConsoleAppender
classLoader sun.misc.Launcher$AppClassLoader@2a139a55
classLoaderHash 2a139a55
target System.out
name APPLICATION
class ch.qos.logback.core.rolling.RollingFileAppender
classLoader sun.misc.Launcher$AppClassLoader@2a139a55
classLoaderHash 2a139a55
file app.log
name ASYNC
class ch.qos.logback.classic.AsyncAppender
classLoader sun.misc.Launcher$AppClassLoader@2a139a55
classLoaderHash 2a139a55
appenderRef [APPLICATION]
```
#### Update logger level
```bash
[arthas@2062]$ logger --name ROOT --level debug
update logger level success.
```
#### View the logger information without appenders
By default, the `logger` command only prints information about the logger with appenders. If you want to see information about loggers without `appender`, you can use the parameter `--include-no-appender`.
Note that the output will usually be very long.
```bash
[arthas@2062]$ logger --include-no-appender
name ROOT
class ch.qos.logback.classic.Logger
classLoader sun.misc.Launcher$AppClassLoader@2a139a55
classLoaderHash 2a139a55
level DEBUG
effectiveLevel DEBUG
additivity true
codeSource file:/Users/hengyunabc/.m2/repository/ch/qos/logback/logback-classic/1.2.3/logback-classic-1.2.3.jar
appenders name CONSOLE
class ch.qos.logback.core.ConsoleAppender
classLoader sun.misc.Launcher$AppClassLoader@2a139a55
classLoaderHash 2a139a55
target System.out
name APPLICATION
class ch.qos.logback.core.rolling.RollingFileAppender
classLoader sun.misc.Launcher$AppClassLoader@2a139a55
classLoaderHash 2a139a55
file app.log
name ASYNC
class ch.qos.logback.classic.AsyncAppender
classLoader sun.misc.Launcher$AppClassLoader@2a139a55
classLoaderHash 2a139a55
appenderRef [APPLICATION]
name com
class ch.qos.logback.classic.Logger
classLoader sun.misc.Launcher$AppClassLoader@2a139a55
classLoaderHash 2a139a55
level null
effectiveLevel DEBUG
additivity true
codeSource file:/Users/hengyunabc/.m2/repository/ch/qos/logback/logback-classic/1.2.3/logback-classic-1.2.3.jar
name com.alibaba
class ch.qos.logback.classic.Logger
classLoader sun.misc.Launcher$AppClassLoader@2a139a55
classLoaderHash 2a139a55
level null
effectiveLevel DEBUG
additivity true
codeSource file:/Users/hengyunabc/.m2/repository/ch/qos/logback/logback-classic/1.2.3/logback-classic-1.2.3.jar
...
```
+2 -2
View File
@@ -5,7 +5,7 @@ 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)
**Latest version, Click To Download**: [![](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)
If the download speed is slow, try to use [Ali cloud mirror repository](https://maven.aliyun.com/), for example, to download version `3.x.x` (you can replace `3.x.x` in the example URL if you want to download other version), the download URL is: https://maven.aliyun.com/repository/public/com/taobao/arthas/arthas-packaging/3.x.x/arthas-packaging-3.x.x-bin.zip
@@ -51,7 +51,7 @@ You can enter its interactive interface by executing `as.sh`, or execute `as.sh
### 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)
Latest Version, Click To Download: [![](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:)
+53
View File
@@ -0,0 +1,53 @@
vmoption
===
> Display, and update the vm diagnostic options.
### Usage
#### View all options
```bash
[arthas@56963]$ vmoption
KEY VALUE ORIGIN WRITEABLE
---------------------------------------------------------------------------------------------
HeapDumpBeforeFullGC false DEFAULT true
HeapDumpAfterFullGC false DEFAULT true
HeapDumpOnOutOfMemory false DEFAULT true
Error
HeapDumpPath DEFAULT true
CMSAbortablePrecleanW 100 DEFAULT true
aitMillis
CMSWaitDuration 2000 DEFAULT true
CMSTriggerInterval -1 DEFAULT true
PrintGC false DEFAULT true
PrintGCDetails true MANAGEMENT true
PrintGCDateStamps false DEFAULT true
PrintGCTimeStamps false DEFAULT true
PrintGCID false DEFAULT true
PrintClassHistogramBe false DEFAULT true
foreFullGC
PrintClassHistogramAf false DEFAULT true
terFullGC
PrintClassHistogram false DEFAULT true
MinHeapFreeRatio 0 DEFAULT true
MaxHeapFreeRatio 100 DEFAULT true
PrintConcurrentLocks false DEFAULT true
```
#### View individual option
```bash
[arthas@56963]$ vmoption PrintGCDetails
KEY VALUE ORIGIN WRITEABLE
---------------------------------------------------------------------------------------------
PrintGCDetails false MANAGEMENT true
```
#### Update individual option
```bash
[arthas@56963]$ vmoption PrintGCDetails true
Successfully updated the vm option.
PrintGCDetails=true
```
+86 -2
View File
@@ -1,11 +1,95 @@
Web Console
===
### Connect arthas through the browser
Arthas supports the Web Console. After attach success, the user can access: [http://127.0.0.1:8563/](http://127.0.0.1:8563/).
The user can fill in the IP and connect the remote arthas on other machines.
![web console](_static/web-console-local.png)
![](_static/web-console-local.png)
> By default, arthas only listens to `127.0.0.1`, so if you want to connect from a remote, you can use the `--target-ip` parameter to specify the IP. See the help description for `-h` for more information.
If you have suggestions for the Web Console, please leave a message here: [https://github.com/alibaba/arthas/issues/15](https://github.com/alibaba/arthas/issues/15)
### Connect remote arthas through arthas tunnel server
#### Download and deploy arthas tunnel server
[https://github.com/alibaba/arthas/releases](https://github.com/alibaba/arthas/releases)
Arthas tunnel server is a spring boot fat jar application, start with the `java -jar` command:
```bash
java -jar arthas-tunnel-server.jar
```
By default, the web port of the arthas tunnel server is `8080`, and the port connected by the arthas agent is `7777`.
Once started, you can go to [http://localhost:8080/](http://localhost:8080/) and connect to the registered arthas agent via `agentId`.
Through Spring Boot's Endpoint, you can view the specific connection information: [http://localhost:8080/actuator/arthas](http://localhost:8080/actuator/arthas), the login user name is `arthas`, and the password can be found in the log of arthas tunnel server, for example:
```
32851 [main] INFO o.s.b.a.s.s.UserDetailsServiceAutoConfiguration
Using generated security password: f1dca050-3777-48f4-a577-6367e55a78a2
```
#### Connecting to the tunnel server when starting arthas
If you have suggestions for the Web Console, please leave a message here: [https://github.com/alibaba/arthas/issues/15](https://github.com/alibaba/arthas/issues/15)
When starting arthas, you can use the `--tunnel-server` parameter, for example:
```bash
as.sh --tunnel-server 'ws://47.75.156.201:7777/ws'
```
* You can specify the agentId by the `--agent-id` parameter. By default, a random ID is generated.
After Arthas attach succeeds, the agentId will be printed, such as:
```bash
,---. ,------. ,--------.,--. ,--. ,---. ,---.
/ O \ | .--. ''--. .--'| '--' | / O \ ' .-'
| .-. || '--'.' | | | .--. || .-. |`. `-.
| | | || |\ \ | | | | | || | | |.-' |
`--' `--'`--' '--' `--' `--' `--'`--' `--'`-----'
wiki https://alibaba.github.io/arthas
tutorials https://alibaba.github.io/arthas/arthas-tutorials
version 3.1.2
pid 86183
time 2019-08-30 15:40:53
id URJZ5L48RPBR2ALI5K4V
```
If the connection is not connected to the tunnel server at startup, you can also obtain the agentId through the `session` command after reconnection succeeds:
```bash
[arthas@86183]$ session
Name Value
-----------------------------------------------------
JAVA_PID 86183
SESSION_ID f7273eb5-e7b0-4a00-bc5b-3fe55d741882
AGENT_ID URJZ5L48RPBR2ALI5K4V
TUNNEL_SERVER ws://47.75.156.201:7777/ws
```
For the above example, go to [http://47.75.156.201:8080/](http://47.75.156.201:8080/) in the browser and input the `agentId` to connect to arthas on remote machine.
![](_static/arthas-tunnel-server.png)
#### How arthas tunnel server works
```
browser <-> arthas tunnel server <-> arthas tunnel client <-> arthas agent
```
[https://github.com/alibaba/arthas/blob/master/tunnel-server/README.md](https://github.com/alibaba/arthas/blob/master/tunnel-server/README.md)