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/assets/manual-install.html.a031e34...

21 lines
8.4 KiB
JavaScript

import{_ as o,o as i,c as r,a,b as t,e,d as s,r as l}from"./app.5024572d.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("p",null,"Download the latest version",-1),h=a("strong",null,"Latest version, Click To Download",-1),u=e(": "),m={href:"https://arthas.aliyun.com/download/latest_version",target:"_blank",rel:"noopener noreferrer"},v=a("img",{src:"https://img.shields.io/maven-central/v/com.taobao.arthas/arthas-packaging.svg?style=flat-square",alt:"",title:"Arthas"},null,-1),b=s(`<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
3 years ago
</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
2 years ago
<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>
3 years ago
<span class="token builtin class-name">cd</span> arthas
./install-local.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>./as.sh
2 years ago
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div></li>`,3),g=s(`<h2 id="startup-with-as-sh-as-bat" tabindex="-1"><a class="header-anchor" href="#startup-with-as-sh-as-bat" aria-hidden="true">#</a> Startup with as.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/install.sh <span class="token operator">|</span> <span class="token function">sh</span>
3 years ago
</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>as.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>as.sh</code>, or execute <code>as.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>`,7),k=e("Latest Version, Click To Download: "),f={href:"https://arthas.aliyun.com/download/latest_version",target:"_blank",rel:"noopener noreferrer"},_=a("img",{src:"https://img.shields.io/maven-central/v/com.taobao.arthas/arthas-packaging.svg?style=flat-square",alt:"",title:"Arthas"},null,-1),x=s(`<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>
2 years ago
</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>
3 years ago
</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>
2 years ago
<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>
3 years ago
-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>
2 years ago
<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
3 years ago
</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>
2 years ago
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div></li></ol>`,9);function w(y,j){const n=l("ExternalLinkIcon");return i(),r("div",null,[d,a("ol",null,[a("li",null,[p,a("p",null,[h,u,a("a",m,[v,t(n)])])]),b]),g,a("p",null,[k,a("a",f,[_,t(n)])]),x])}const I=o(c,[["render",w],["__file","manual-install.html.vue"]]);export{I as default};