import{_ as o,o as i,c as r,a,b as t,e,d as s,r as l}from"./app.6c27e557.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(`
  • Unzip zip file

    unzip arthas-packaging-bin.zip
    
  • Install Arthas

    It is recommended to completely remove all old versions of Arthas before installation.

    sudo su admin
    rm -rf /home/admin/.arthas/lib/* # remove all the leftover of the old outdated Arthas
    cd arthas
    ./install-local.sh # switch the user based on the owner of the target Java process.
    
  • Start Arthas

    Make sure stop the old Arthas server before start.

    ./as.sh
    
  • `,3),g=s(`

    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:

    curl -L https://arthas.aliyun.com/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

    `,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(`

    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 \u2764\uFE0F)

    as.bat <pid>
    

    If you want to diagnose Java process run as windows service, try these commands:

    as-service.bat -port <port>
    as-service.bat -pid <pid>
    as-service.bat -pid <pid> --interact
    

    Use this command to remove arthas service:

    as-service.bat -remove
    

    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:

    2. Assemble bootstrap command:

      Let's suppose we are using /opt/jdk1.8/bin/java, then the command should be:

      /opt/jdk1.8/bin/java -Xbootclasspath/a:/opt/jdk1.8/lib/tools.jar \\
          -jar /tmp/arthas-packaging/arthas-core.jar \\
          -pid 15146 \\
          -target-ip 127.0.0.1 -telnet-port 3658 -http-port 8563 \\
          -core /tmp/arthas-packaging/arthas-core.jar \\
          -agent /tmp/arthas-packaging/arthas/arthas-agent.jar
      

      Note:

      If you are running on JDK 1.9 or above\uFF0Cthen it's unnecessary to add tools.jar in option -Xbootclasspath.

      You can find the logs from ~/logs/arthas/arthas.log.

    3. Use telnet to connect once attaching to the target JVM (in step 2) succeeds

      telnet 127.0.0.1 3658
      
    `,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};