当前位置:网站首页>Offline installation method of Arthas without network environment

Offline installation method of Arthas without network environment

2020-11-09 13:44:09 anshu

This paper mainly introduces When the server cannot connect to the Internet , Unable to install arthas Solutions for .

One 、 download

Reference article at the end of the article 3 Download . You can also take out the link in the following article directly , Download directly from the downloader .

# github download 
wget https://alibaba.github.io/arthas/arthas-boot.jar
#  perhaps  Gitee  download 
wget https://arthas.gitee.io/arthas-boot.jar
#  Print help 
java -jar arthas-boot.jar -h

Two 、 install

#  Operation mode 1, First run , In the choice  Java  process  PID
java -jar arthas-boot.jar

When the network is installed , It can be installed normally . Look at the execution log below , You can see , When you connect to the Internet, you'll get maven.aliyun.com Get it from the private server library jar package . But offline , It can't be obtained directly , Execution time , There will be no connection aliyun.com etc. error.

Downloads herman$ java -jar arthas-boot.jar
[INFO] arthas-boot version: 3.1.7
[INFO] Found existing java process, please choose one and hit RETURN.
* [1]: 59874 com.dtm.starter.StartApplication
  [2]: 26057
  [3]: 68065 com.bayss.infin.core.AppStarter
1
[INFO] Start download arthas from remote server: http://maven.aliyun.com/repository/public/com/taobao/arthas/arthas-packaging/3.1.7/arthas-packaging-3.1.7-bin.zip
[INFO] File size: 10.33 MB, downloaded size: 1.08 MB, downloading ...
[INFO] File size: 10.33 MB, downloaded size: 2.15 MB, downloading ...
[INFO] File size: 10.33 MB, downloaded size: 3.23 MB, downloading ...
[INFO] File size: 10.33 MB, downloaded size: 4.38 MB, downloading ...
[INFO] File size: 10.33 MB, downloaded size: 5.40 MB, downloading ...
[INFO] File size: 10.33 MB, downloaded size: 6.54 MB, downloading ...
[INFO] File size: 10.33 MB, downloaded size: 7.52 MB, downloading ...
[INFO] File size: 10.33 MB, downloaded size: 8.66 MB, downloading ...
[INFO] File size: 10.33 MB, downloaded size: 9.71 MB, downloading ...
[INFO] Download arthas success.
[INFO] arthas home: /Users/herman/.arthas/lib/3.1.7/arthas
[INFO] Try to attach process 59874
[WARN] Current VM java version: 1.7 do not match target VM java version: 1.8, attach may fail.
[WARN] Target VM JAVA_HOME is /Library/Java/JavaVirtualMachines/jdk1.8.0_91.jdk/Contents/Home/jre, arthas-boot JAVA_HOME is /Library/Java/JavaVirtualMachines/jdk1.7.0_80.jdk/Contents/Home/jre, try to set the same JAVA_HOME.
[INFO] Attach process 59874 success.
[INFO] arthas-client connect 127.0.0.1 3658
  ,---.  ,------. ,--------.,--.  ,--.  ,---.   ,---.
 /  O  \ |  .--. ''--.  .--'|  '--'  | /  O  \ '   .-'
|  .-.  ||  '--'.'   |  |   |  .--.  ||  .-.  |`.  `-.
|  | |  ||  |\  \    |  |   |  |  |  ||  | |  |.-'    |
`--' `--'`--' '--'   `--'   `--'  `--'`--' `--'`-----'


wiki      https://alibaba.github.io/arthas
tutorials https://alibaba.github.io/arthas/arthas-tutorials
version   3.1.7
pid       59874
time      2020-01-02 10:48:28

3、 ... and 、 Offline installation

In fact, the method is very simple , It's just that sometimes it's hard to think of .
step 1: First on a computer that can be connected to the Internet , perform java -jar arthas-boot.jar, You can see from the execution record that , The downloaded dependency package is placed in

[INFO] arthas home: /Users/herman/.arthas/lib/3.1.7/arthas

step 2: Enter into /Users/herman/.arthas/lib/3.1.7/arthas Under the path , Just pack everything up , And arthas-boot.jar Upload to offline servers together .

BUG:arthas herman$ ll
total 23048
-rw-r--r--  1 herman  staff      5993  1  2 10:48 arthas-spy.jar
-rw-r--r--  1 herman  staff      8347  1  2 10:48 arthas-agent.jar
-rw-r--r--  1 herman  staff    403091  1  2 10:48 arthas-client.jar
-rw-r--r--  1 herman  staff    111090  1  2 10:48 arthas-boot.jar
-rw-r--r--  1 herman  staff      3739  1  2 10:48 arthas-demo.jar
-rw-r--r--  1 herman  staff       635  1  2 10:48 install-local.sh
-rw-r--r--  1 herman  staff     28075  1  2 10:48 as.sh
-rw-r--r--  1 herman  staff      3127  1  2 10:48 as.bat
-rw-r--r--  1 herman  staff      7744  1  2 10:48 as-service.bat
drwxr-xr-x  4 herman  staff       128  1  2 10:48 async-profiler
-rw-r--r--  1 herman  staff  11207868  1  2 10:48 arthas-core.jar
BUG:arthas herman$ pwd
/Users/herman/.arthas/lib/3.1.7/arthas

Packing command :tar -cvf perhaps zip, You can use a file browser

step 3: Put the packaged files in the user root directory on the server , such as herman user , Put it in /home/herman/.arthas You can just . Of course, you can also specify the execution path .

Related reference articles :

1. 《arthas Installation instructions 》 https://blog.csdn.net/zou100/article/details/84998559

2. 《arthas Summary of installation and use of 》https://blog.csdn.net/wangwei249/article/details/86595540

3. 《Arthas - Java The ultimate weapon of online problem location processing 》https://mp.weixin.qq.com/s/55gBspFp8yH0TCymdbZfkQ

版权声明
本文为[anshu]所创,转载请带上原文链接,感谢