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/3.x/assets/manual-install.html.aba050d...

21 lines
8.3 KiB
JavaScript

import{_ as o,o as i,c as r,a,b as n,e,d as t,r as l}from"./app.4d248835.js";const c={},d=a("h1",{id:"manually-install-arthas",tabindex:"-1"},[a("a",{class:"header-anchor",href:"#manually-install-arthas","aria-hidden":"true"},"#"),e(" Manually Install Arthas")],-1),p=a("ol",null,[a("li",null,"Download the latest version")],-1),h=a("p",null,"Download from Github Releases",-1),u={href:"https://github.com/alibaba/arthas/releases",target:"_blank",rel:"noopener noreferrer"},m=e("https://github.com/alibaba/arthas/releases"),b=t(`<ol start="2"><li><p>Unzip zip file</p><div class="language-bash ext-sh line-numbers-mode"><pre class="language-bash"><code><span class="token function">unzip</span> arthas-packaging-bin.zip
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div></li><li><p>Install Arthas</p><p>It is recommended to completely remove all old versions of Arthas before installation.</p><div class="language-bash ext-sh line-numbers-mode"><pre class="language-bash"><code><span class="token function">sudo</span> <span class="token function">su</span> admin
<span class="token function">rm</span> <span class="token parameter variable">-rf</span> /home/admin/.arthas/lib/* <span class="token comment"># remove all the leftover of the old outdated Arthas</span>
<span class="token builtin class-name">cd</span> arthas
./install-local3.sh <span class="token comment"># switch the user based on the owner of the target Java process.</span>
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div></li><li><p>Start Arthas</p><p>Make sure <code>stop</code> the old Arthas server before start.</p><div class="language-bash ext-sh line-numbers-mode"><pre class="language-bash"><code>./as3.sh
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div></li></ol><h2 id="startup-with-as3-sh-as-bat" tabindex="-1"><a class="header-anchor" href="#startup-with-as3-sh-as-bat" aria-hidden="true">#</a> Startup with as3.sh/as.bat</h2><h3 id="linux-unix-mac" tabindex="-1"><a class="header-anchor" href="#linux-unix-mac" aria-hidden="true">#</a> Linux/Unix/Mac</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><div class="language-bash ext-sh line-numbers-mode"><pre class="language-bash"><code><span class="token function">curl</span> <span class="token parameter variable">-L</span> https://arthas.aliyun.com/install3.sh <span class="token operator">|</span> <span class="token function">sh</span>
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div><p>The command above will download the bootstrap script <code>as3.sh</code> to the current directory. You can move it the any other place you want, or put its location in <code>$PATH</code>.</p><p>You can enter its interactive interface by executing <code>as3.sh</code>, or execute <code>as3.sh -h</code> for more help information.</p><h3 id="windows" tabindex="-1"><a class="header-anchor" href="#windows" aria-hidden="true">#</a> Windows</h3>`,8),v=e("Latest Version, Click To Download: "),g={href:"https://arthas.aliyun.com/download/latest_version",target:"_blank",rel:"noopener noreferrer"},k=a("img",{src:"https://img.shields.io/maven-central/v/com.taobao.arthas/arthas-packaging.svg?style=flat-square",alt:"",title:"Arthas"},null,-1),f=t(`<p>Download and unzip, then find <code>as.bat</code> from &#39;bin&#39; directory. For now this script will only take one argument <code>pid</code>, which means you can only diagnose the local Java process. (Welcome any bat script expert to make it better \u2764\uFE0F)</p><div class="language-bash ext-sh line-numbers-mode"><pre class="language-bash"><code>as.bat <span class="token operator">&lt;</span>pid<span class="token operator">&gt;</span>
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div><p>If you want to diagnose Java process run as windows service, try these commands:</p><div class="language-bash ext-sh line-numbers-mode"><pre class="language-bash"><code>as-service.bat <span class="token parameter variable">-port</span> <span class="token operator">&lt;</span>port<span class="token operator">&gt;</span>
as-service.bat <span class="token parameter variable">-pid</span> <span class="token operator">&lt;</span>pid<span class="token operator">&gt;</span>
as-service.bat <span class="token parameter variable">-pid</span> <span class="token operator">&lt;</span>pid<span class="token operator">&gt;</span> <span class="token parameter variable">--interact</span>
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>Use this command to remove arthas service:</p><div class="language-bash ext-sh line-numbers-mode"><pre class="language-bash"><code>as-service.bat <span class="token parameter variable">-remove</span>
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div><h2 id="manual-command-line-startup" tabindex="-1"><a class="header-anchor" href="#manual-command-line-startup" aria-hidden="true">#</a> Manual command line startup</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><p>Locate java in the target JVM:</p><ul><li>Linux/Unix/Mac: <code>ps aux | grep java</code></li><li>Windows: open the Process Monitor to search java</li></ul></li><li><p>Assemble bootstrap command:</p><p>Let&#39;s suppose we are using <code>/opt/jdk1.8/bin/java</code>, then the command should be:</p><div class="language-bash ext-sh line-numbers-mode"><pre class="language-bash"><code>/opt/jdk1.8/bin/java -Xbootclasspath/a:/opt/jdk1.8/lib/tools.jar <span class="token punctuation">\\</span>
<span class="token parameter variable">-jar</span> /tmp/arthas-packaging/arthas-core.jar <span class="token punctuation">\\</span>
<span class="token parameter variable">-pid</span> <span class="token number">15146</span> <span class="token punctuation">\\</span>
-target-ip <span class="token number">127.0</span>.0.1 -telnet-port <span class="token number">3658</span> -http-port <span class="token number">8563</span> <span class="token punctuation">\\</span>
<span class="token parameter variable">-core</span> /tmp/arthas-packaging/arthas-core.jar <span class="token punctuation">\\</span>
<span class="token parameter variable">-agent</span> /tmp/arthas-packaging/arthas/arthas-agent.jar
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>Note:</p><ul><li><code>-Xbootclasspath</code> adds tools.jar</li><li><code>-jar /tmp/arthas-packaging/arthas-core.jar</code> specifies main entry</li><li><code>-pid 15146</code> specifies the target java process PID</li><li><code>-target-ip 127.0.0.1</code> specifies the IP</li><li><code>-telnet-port 3658 -http-port 8563</code> specifies telnet and HTTP ports for remote access</li><li><code>-core /tmp/arthas-packaging/arthas-core.jar -agent /tmp/arthas-packaging/arthas/arthas-agent.jar</code> specifies core/agent jar package</li></ul><p>If you are running on JDK 1.9 or above\uFF0Cthen it&#39;s unnecessary to add <code>tools.jar</code> in option <code>-Xbootclasspath</code>.</p><p>You can find the logs from <code>~/logs/arthas/arthas.log</code>.</p></li><li><p>Use telnet to connect once attaching to the target JVM (in step 2) succeeds</p><div class="language-bash ext-sh line-numbers-mode"><pre class="language-bash"><code>telnet <span class="token number">127.0</span>.0.1 <span class="token number">3658</span>
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div></li></ol>`,9);function _(x,w){const s=l("ExternalLinkIcon");return i(),r("div",null,[d,p,h,a("p",null,[a("a",u,[m,n(s)])]),b,a("p",null,[v,a("a",g,[k,n(s)])]),f])}const j=o(c,[["render",_],["__file","manual-install.html.vue"]]);export{j as default};