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 <pid>
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:
- Linux/Unix/Mac: `ps aux | grep java`
- Windows: open the Process Monitor to search java
2. Assemble bootstrap command:
Print usage:
Let's suppose we are using `/opt/jdk1.8/bin/java`, then the command should be:
**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 <pid>
```
## 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:
`arthas-demo` is a simple program that generates a random number every second, then find all prime factors of the number.
If there is no `arthas-demo.jar` locally, you can download it from here:[Click](http://repository.sonatype.org/service/local/artifact/maven/redirect?r=central-proxy&g=com.taobao.arthas&a=arthas-boot&v=LATEST)
You can also compile code by youself:[View](https://github.com/alibaba/arthas/blob/master/demo/src/main/java/demo)
The source code of `arthas-demo`: [View](https://github.com/alibaba/arthas/blob/master/demo/src/main/java/demo/MathGame.java)
## 2. Start Arthas
@ -21,10 +19,13 @@ You can also compile code by youself:[View](https://github.com/alibaba/arthas/bl
Execute the following command in the command line:
> The user to run this command *MUST* have the same privilege as the owner of the target process, as a simple example you can try the following command if the target process is managed by user `admin`: `sudo su admin && java -jar arthas-boot.jar` or `sudo -u admin -EH java -jar arthas-boot.jar`.If you cannot be able to attach to the target process, please check the logs under `~/logs/arthas` for troubleshooting.
* The user to run this command *MUST* have the same privilege as the owner of the target process, as a simple example you can try the following command if the target process is managed by user `admin`: `sudo su admin && java -jar arthas-boot.jar` or `sudo -u admin -EH java -jar arthas-boot.jar`
* .If you cannot be able to attach to the target process, please check the logs under `~/logs/arthas` for troubleshooting.
<spanid="install-arthas"></span><h1>Install Arthas<aclass="headerlink"href="#install-arthas"title="Permalink to this headline">¶</a></h1>
<divclass="section"id="all-platform-recommended">
<spanid="all-platform-recommended"></span><h2>All Platform (recommended)<aclass="headerlink"href="#all-platform-recommended"title="Permalink to this headline">¶</a></h2>
<p>Latest Version, Click To Download: <aclass="reference external"href="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"><imgalt="Arthas"src="https://img.shields.io/maven-central/v/com.taobao.arthas/arthas-packaging.svg?style=flat-square"/></a></p>
<p>Download and unzip, find <codeclass="docutils literal notranslate"><spanclass="pre">arthas-boot.jar</span></code> in the directory. Start with <codeclass="docutils literal notranslate"><spanclass="pre">java</span></code> command:</p>
<spanid="quick-installation"></span><h2>Quick installation<aclass="headerlink"href="#quick-installation"title="Permalink to this headline">¶</a></h2>
<divclass="section"id="use-arthas-boot">
<spanid="use-arthas-boot"></span><h3>Use <codeclass="docutils literal notranslate"><spanclass="pre">arthas-boot</span></code><aclass="headerlink"href="#use-arthas-boot"title="Permalink to this headline">¶</a></h3>
<p>Download<codeclass="docutils literal notranslate"><spanclass="pre">arthas-boot.jar</span></code>,Start with <codeclass="docutils literal notranslate"><spanclass="pre">java</span></code> command:</p>
<spanid="linux-unix-mac"></span><h2>Linux/Unix/Mac<aclass="headerlink"href="#linux-unix-mac" title="Permalink to this headline">¶</a></h2>
<divclass="section"id="use-as-sh">
<spanid="use-as-sh"></span><h3>Use <codeclass="docutils literal notranslate"><spanclass="pre">as.sh</span></code><aclass="headerlink"href="#use-as-sh" title="Permalink to this headline">¶</a></h3>
<p>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 <em>Enter</em> to run:</p>
<divclass="highlight-bash notranslate"><divclass="highlight"><pre><span></span>curl -L https://alibaba.github.io/arthas/install.sh <spanclass="p">|</span> sh
</pre></div>
@ -195,53 +200,22 @@
<p>The command above will download the bootstrap script <codeclass="docutils literal notranslate"><spanclass="pre">as.sh</span></code> to the current directory. You can move it the any other place you want, or put its location in <codeclass="docutils literal notranslate"><spanclass="pre">$PATH</span></code>.</p>
<p>You can enter its interactive interface by executing <codeclass="docutils literal notranslate"><spanclass="pre">as.sh</span></code>, or execute <codeclass="docutils literal notranslate"><spanclass="pre">as.sh</span><spanclass="pre">-h</span></code> for more help information.</p>
</div>
<divclass="section"id="windows">
<spanid="windows"></span><h2>Windows<aclass="headerlink"href="#windows"title="Permalink to this headline">¶</a></h2>
</div>
<divclass="section"id="full-installation">
<spanid="full-installation"></span><h2>Full installation<aclass="headerlink"href="#full-installation"title="Permalink to this headline">¶</a></h2>
<p>Latest Version, Click To Download: <aclass="reference external"href="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"><imgalt="Arthas"src="https://img.shields.io/maven-central/v/com.taobao.arthas/arthas-packaging.svg?style=flat-square"/></a></p>
<p>Download and unzip, then find <codeclass="docutils literal notranslate"><spanclass="pre">as.bat</span></code> from ‘bin’ directory. For now this script will only take one argument <codeclass="docutils literal notranslate"><spanclass="pre">pid</span></code>, which means you can only diagnose the local Java process. (Welcome any bat script expert to make it better :heart:)</p>
<p>Download and unzip, find <codeclass="docutils literal notranslate"><spanclass="pre">arthas-boot.jar</span></code> in the directory. Start with <codeclass="docutils literal notranslate"><spanclass="pre">java</span></code> command:</p>
<spanid="manual-installation"></span><h2>Manual Installation<aclass="headerlink"href="#manual-installation"title="Permalink to this headline">¶</a></h2>
<p>Let’s suppose we are using <codeclass="docutils literal notranslate"><spanclass="pre">/opt/jdk1.8/bin/java</span></code>, then the command should be:</p>
<li><codeclass="docutils literal notranslate"><spanclass="pre">-jar</span><spanclass="pre">/tmp/arthas-packaging/arthas-core.jar</span></code> specifies main entry</li>
<li><codeclass="docutils literal notranslate"><spanclass="pre">-pid</span><spanclass="pre">15146</span></code> specifies the target java process PID</li>
<li><codeclass="docutils literal notranslate"><spanclass="pre">-target-ip</span><spanclass="pre">127.0.0.1</span></code> specifies the IP</li>
<li><codeclass="docutils literal notranslate"><spanclass="pre">-telnet-port</span><spanclass="pre">3658</span><spanclass="pre">-http-port</span><spanclass="pre">8563</span></code> specifies telnet and HTTP ports for remote access</li>
<li><codeclass="docutils literal notranslate"><spanclass="pre">-core</span><spanclass="pre">/tmp/arthas-packaging/arthas-core.jar</span><spanclass="pre">-agent</span><spanclass="pre">/tmp/arthas-packaging/arthas/arthas-agent.jar</span></code> specifies core/agent jar package</li>
</ul>
<p>If you are running on JDK 1.9 or above,then it’s unncessary to add <codeclass="docutils literal notranslate"><spanclass="pre">tools.jar</span></code> in option <codeclass="docutils literal notranslate"><spanclass="pre">-Xbootclasspath</span></code>.</p>
<p>You can find the logs from <codeclass="docutils literal notranslate"><spanclass="pre">~/logs/arthas/arthas.log</span></code>.</p>
</li>
<li><pclass="first">Use telnet to connect once attaching to the target JVM (in step 2) succeeds</p>
<spanid="offline-help-documentation"></span><h2>Offline Help Documentation<aclass="headerlink"href="#offline-help-documentation"title="Permalink to this headline">¶</a></h2>
@ -255,7 +229,7 @@
</pre></div>
</div>
</li>
<li><pclass="first">On Windows, simply delete the zip file and unzipped files.</p>
<li><pclass="first">On Windows, delete <codeclass="docutils literal notranslate"><spanclass="pre">.arthas</span></code> directory under user home.</p>
<spanid="manually-install-arthas"></span><h1>Manually Install Arthas<aclass="headerlink"href="#manually-install-arthas"title="Permalink to this headline">¶</a></h1>
<divclass="section"id="manually-install-arthas">
<spanid="id1"></span><h2>Manually Install Arthas<aclass="headerlink"href="#manually-install-arthas"title="Permalink to this headline">¶</a></h2>
<ol>
<li><pclass="first">Download the latest version</p>
<p><strong>Latest version, Click To Download</strong>: <aclass="reference external"href="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"><imgalt="Arthas"src="https://img.shields.io/maven-central/v/com.taobao.arthas/arthas-packaging.svg?style=flat-square"/></a></p>
@ -190,6 +192,66 @@ rm -rf /home/admin/.arthas/lib/* <span class="c1"># remove all the leftover of t
<spanid="startup-with-as-sh-as-bat"></span><h2>Startup with as.sh/as.bat<aclass="headerlink"href="#startup-with-as-sh-as-bat"title="Permalink to this headline">¶</a></h2>
<divclass="section"id="linux-unix-mac">
<spanid="linux-unix-mac"></span><h3>Linux/Unix/Mac<aclass="headerlink"href="#linux-unix-mac"title="Permalink to this headline">¶</a></h3>
<p>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 <em>Enter</em> to run:</p>
<divclass="highlight-bash notranslate"><divclass="highlight"><pre><span></span>curl -L https://alibaba.github.io/arthas/install.sh <spanclass="p">|</span> sh
</pre></div>
</div>
<p>The command above will download the bootstrap script <codeclass="docutils literal notranslate"><spanclass="pre">as.sh</span></code> to the current directory. You can move it the any other place you want, or put its location in <codeclass="docutils literal notranslate"><spanclass="pre">$PATH</span></code>.</p>
<p>You can enter its interactive interface by executing <codeclass="docutils literal notranslate"><spanclass="pre">as.sh</span></code>, or execute <codeclass="docutils literal notranslate"><spanclass="pre">as.sh</span><spanclass="pre">-h</span></code> for more help information.</p>
</div>
<divclass="section"id="windows">
<spanid="windows"></span><h3>Windows<aclass="headerlink"href="#windows"title="Permalink to this headline">¶</a></h3>
<p>Latest Version, Click To Download: <aclass="reference external"href="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"><imgalt="Arthas"src="https://img.shields.io/maven-central/v/com.taobao.arthas/arthas-packaging.svg?style=flat-square"/></a></p>
<p>Download and unzip, then find <codeclass="docutils literal notranslate"><spanclass="pre">as.bat</span></code> from ‘bin’ directory. For now this script will only take one argument <codeclass="docutils literal notranslate"><spanclass="pre">pid</span></code>, which means you can only diagnose the local Java process. (Welcome any bat script expert to make it better :heart:)</p>
<spanid="manual-command-line-startup"></span><h2>Manual command line startup<aclass="headerlink"href="#manual-command-line-startup"title="Permalink to this headline">¶</a></h2>
<p>If you fail to boot Arthas with the provided batch file, you could try to assemble the bootstrap command in the following way.</p>
<ol>
<li><pclass="first">Locate java in the target JVM:</p>
<p>Let’s suppose we are using <codeclass="docutils literal notranslate"><spanclass="pre">/opt/jdk1.8/bin/java</span></code>, then the command should be:</p>
<li><codeclass="docutils literal notranslate"><spanclass="pre">-jar</span><spanclass="pre">/tmp/arthas-packaging/arthas-core.jar</span></code> specifies main entry</li>
<li><codeclass="docutils literal notranslate"><spanclass="pre">-pid</span><spanclass="pre">15146</span></code> specifies the target java process PID</li>
<li><codeclass="docutils literal notranslate"><spanclass="pre">-target-ip</span><spanclass="pre">127.0.0.1</span></code> specifies the IP</li>
<li><codeclass="docutils literal notranslate"><spanclass="pre">-telnet-port</span><spanclass="pre">3658</span><spanclass="pre">-http-port</span><spanclass="pre">8563</span></code> specifies telnet and HTTP ports for remote access</li>
<li><codeclass="docutils literal notranslate"><spanclass="pre">-core</span><spanclass="pre">/tmp/arthas-packaging/arthas-core.jar</span><spanclass="pre">-agent</span><spanclass="pre">/tmp/arthas-packaging/arthas/arthas-agent.jar</span></code> specifies core/agent jar package</li>
</ul>
<p>If you are running on JDK 1.9 or above,then it’s unncessary to add <codeclass="docutils literal notranslate"><spanclass="pre">tools.jar</span></code> in option <codeclass="docutils literal notranslate"><spanclass="pre">-Xbootclasspath</span></code>.</p>
<p>You can find the logs from <codeclass="docutils literal notranslate"><spanclass="pre">~/logs/arthas/arthas.log</span></code>.</p>
</li>
<li><pclass="first">Use telnet to connect once attaching to the target JVM (in step 2) succeeds</p>
<spanid="quick-start"></span><h1>Quick Start<aclass="headerlink"href="#quick-start"title="Permalink to this headline">¶</a></h1>
<divclass="section"id="start-demo-application">
<spanid="start-demo-application"></span><h2>1. Start Demo Application<aclass="headerlink"href="#start-demo-application"title="Permalink to this headline">¶</a></h2>
<p><codeclass="docutils literal notranslate"><spanclass="pre">arthas-demo</span></code> is a simple program that generates a random number every second, then find all prime factors of the number.</p>
<p>If there is no <codeclass="docutils literal notranslate"><spanclass="pre">arthas-demo.jar</span></code> locally, you can download it from here:<aclass="reference external"href="http://repository.sonatype.org/service/local/artifact/maven/redirect?r=central-proxy&g=com.taobao.arthas&a=arthas-boot&v=LATEST">Click</a></p>
<p>You can also compile code by youself:<aclass="reference external"href="https://github.com/alibaba/arthas/blob/master/demo/src/main/java/demo">View</a></p>
<p>The source code of <codeclass="docutils literal notranslate"><spanclass="pre">arthas-demo</span></code>: <aclass="reference external"href="https://github.com/alibaba/arthas/blob/master/demo/src/main/java/demo/MathGame.java">View</a></p>
</div>
<divclass="section"id="start-arthas">
<spanid="start-arthas"></span><h2>2. Start Arthas<aclass="headerlink"href="#start-arthas"title="Permalink to this headline">¶</a></h2>
<divclass="section"id="linux-unix-mac">
<spanid="linux-unix-mac"></span><h3>Linux/Unix/Mac<aclass="headerlink"href="#linux-unix-mac"title="Permalink to this headline">¶</a></h3>
<p>Execute the following command in the command line:</p>
<div>The user to run this command <em>MUST</em> have the same privilege as the owner of the target process, as a simple example you can try the following command if the target process is managed by user <codeclass="docutils literal notranslate"><spanclass="pre">admin</span></code>: <codeclass="docutils literal notranslate"><spanclass="pre">sudo</span><spanclass="pre">su</span><spanclass="pre">admin</span><spanclass="pre">&&</span><spanclass="pre">java</span><spanclass="pre">-jar</span><spanclass="pre">arthas-boot.jar</span></code> or <codeclass="docutils literal notranslate"><spanclass="pre">sudo</span><spanclass="pre">-u</span><spanclass="pre">admin</span><spanclass="pre">-EH</span><spanclass="pre">java</span><spanclass="pre">-jar</span><spanclass="pre">arthas-boot.jar</span></code>.If you cannot be able to attach to the target process, please check the logs under <codeclass="docutils literal notranslate"><spanclass="pre">~/logs/arthas</span></code> for troubleshooting.</div></blockquote>
<ulclass="simple">
<li>The user to run this command <em>MUST</em> have the same privilege as the owner of the target process, as a simple example you can try the following command if the target process is managed by user <codeclass="docutils literal notranslate"><spanclass="pre">admin</span></code>: <codeclass="docutils literal notranslate"><spanclass="pre">sudo</span><spanclass="pre">su</span><spanclass="pre">admin</span><spanclass="pre">&&</span><spanclass="pre">java</span><spanclass="pre">-jar</span><spanclass="pre">arthas-boot.jar</span></code> or <codeclass="docutils literal notranslate"><spanclass="pre">sudo</span><spanclass="pre">-u</span><spanclass="pre">admin</span><spanclass="pre">-EH</span><spanclass="pre">java</span><spanclass="pre">-jar</span><spanclass="pre">arthas-boot.jar</span></code></li>
<li>.If you cannot be able to attach to the target process, please check the logs under <codeclass="docutils literal notranslate"><spanclass="pre">~/logs/arthas</span></code> for troubleshooting.</li>