import{_ as o,a as c,b as d}from"./tunnel-server-agents.03d5eafa.js";import{_ as p,o as h,c as u,a as e,b as n,w as l,e as s,d as t,r as i}from"./app.5024572d.js";const v={},_=e("h1",{id:"arthas-tunnel",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#arthas-tunnel","aria-hidden":"true"},"#"),s(" Arthas Tunnel")],-1),b=e("p",null,"\u901A\u8FC7 Arthas Tunnel Server/Client \u6765\u8FDC\u7A0B\u7BA1\u7406/\u8FDE\u63A5\u591A\u4E2A Agent\u3002",-1),m=e("p",null,"\u6BD4\u5982\uFF0C\u5728\u6D41\u5F0F\u8BA1\u7B97\u91CC\uFF0CJava \u8FDB\u7A0B\u53EF\u4EE5\u662F\u5728\u4E0D\u540C\u7684\u673A\u5668\u542F\u52A8\u7684\uFF0C\u60F3\u8981\u4F7F\u7528 Arthas \u53BB\u8BCA\u65AD\u4F1A\u6BD4\u8F83\u9EBB\u70E6\uFF0C\u56E0\u4E3A\u7528\u6237\u901A\u5E38\u6CA1\u6709\u673A\u5668\u7684\u6743\u9650\uFF0C\u5373\u4F7F\u767B\u9646\u673A\u5668\u4E5F\u5206\u4E0D\u6E05\u662F\u54EA\u4E2A Java \u8FDB\u7A0B\u3002",-1),g=e("p",null,"\u5728\u8FD9\u79CD\u60C5\u51B5\u4E0B\uFF0C\u53EF\u4EE5\u4F7F\u7528 Arthas Tunnel Server/Client\u3002",-1),k=e("p",null,"\u53C2\u8003:",-1),f=s("1: "),x=s("Web Console"),w=s("2: "),A=s("Arthas Spring Boot Starter"),I=e("h2",{id:"\u4E0B\u8F7D\u90E8\u7F72-arthas-tunnel-server",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#\u4E0B\u8F7D\u90E8\u7F72-arthas-tunnel-server","aria-hidden":"true"},"#"),s(" \u4E0B\u8F7D\u90E8\u7F72 arthas tunnel server")],-1),E={href:"https://github.com/alibaba/arthas/releases",target:"_blank",rel:"noopener noreferrer"},N=s("https://github.com/alibaba/arthas/releases"),R=s("\u4ECE Maven \u4ED3\u5E93\u4E0B\u8F7D\uFF1A"),L={href:"https://arthas.aliyun.com/download/arthas-tunnel-server/latest_version?mirror=aliyun",target:"_blank",rel:"noopener noreferrer"},S=e("img",{src:"https://img.shields.io/maven-central/v/com.taobao.arthas/arthas-packaging.svg?style=flat-square",alt:"",title:"Arthas"},null,-1),y=s("\u4ECE Github Releases \u9875\u4E0B\u8F7D\uFF1A "),T={href:"https://github.com/alibaba/arthas/releases",target:"_blank",rel:"noopener noreferrer"},V=s("https://github.com/alibaba/arthas/releases"),j=t(`
Arthas tunnel server \u662F\u4E00\u4E2A spring boot fat jar \u5E94\u7528\uFF0C\u76F4\u63A5java -jar
\u542F\u52A8\uFF1A
java -jar arthas-tunnel-server.jar
\u9ED8\u8BA4\u60C5\u51B5\u4E0B\uFF0Carthas tunnel server \u7684 web \u7AEF\u53E3\u662F8080
\uFF0Carthas agent \u8FDE\u63A5\u7684\u7AEF\u53E3\u662F7777
\u3002
32851 [main] INFO o.s.b.a.s.s.UserDetailsServiceAutoConfiguration
Using generated security password: f1dca050-3777-48f4-a577-6367e55a78a2
\u5728\u542F\u52A8 arthas\uFF0C\u53EF\u4EE5\u4F20\u9012--tunnel-server
\u53C2\u6570\uFF0C\u6BD4\u5982\uFF1A
as.sh --tunnel-server 'ws://127.0.0.1:7777/ws'
\u4E5F\u53EF\u4EE5\u4F7F\u7528\u4E0B\u9762\u7684\u6D4B\u8BD5\u5730\u5740\uFF08\u4E0D\u4FDD\u8BC1\u4E00\u76F4\u53EF\u7528\uFF09\uFF1A
as.sh --tunnel-server 'ws://47.75.156.201:80/ws'
--agent-id
\u53C2\u6570\u91CC\u6307\u5B9A agentId\u3002\u9ED8\u8BA4\u60C5\u51B5\u4E0B\uFF0C\u4F1A\u751F\u6210\u968F\u673A ID\u3002attach \u6210\u529F\u4E4B\u540E\uFF0C\u4F1A\u6253\u5370\u51FA agentId\uFF0C\u6BD4\u5982\uFF1A
,---. ,------. ,--------.,--. ,--. ,---. ,---.
/ O \\ | .--. ''--. .--'| '--' | / O \\ ' .-'
| .-. || '--'.' | | | .--. || .-. |\`. \`-.
| | | || |\\ \\ | | | | | || | | |.-' |
\`--' \`--'\`--' '--' \`--' \`--' \`--'\`--' \`--'\`-----'
wiki https://arthas.aliyun.com/doc
tutorials https://arthas.aliyun.com/doc/arthas-tutorials.html
version 3.1.2
pid 86183
time 2019-08-30 15:40:53
id URJZ5L48RPBR2ALI5K4V
\u5982\u679C\u662F\u542F\u52A8\u65F6\u6CA1\u6709\u8FDE\u63A5\u5230 tunnel server\uFF0C\u4E5F\u53EF\u4EE5\u5728\u540E\u7EED\u81EA\u52A8\u91CD\u8FDE\u6210\u529F\u4E4B\u540E\uFF0C\u901A\u8FC7 session \u547D\u4EE4\u6765\u83B7\u53D6 agentId\uFF1A
[arthas@86183]$ session
Name Value
-----------------------------------------------------
JAVA_PID 86183
SESSION_ID f7273eb5-e7b0-4a00-bc5b-3fe55d741882
AGENT_ID URJZ5L48RPBR2ALI5K4V
TUNNEL_SERVER ws://47.75.156.201:80/ws
\u63D0\u793A
\u6CE8\u610F\uFF0CagentId \u8981\u4FDD\u6301\u552F\u4E00\uFF0C\u5426\u5219\u4F1A\u5728 tunnel server \u4E0A\u51B2\u7A81\uFF0C\u4E0D\u80FD\u6B63\u5E38\u5DE5\u4F5C\u3002
\u5982\u679C arthas agent \u914D\u7F6E\u4E86 appName
\uFF0C\u5219\u751F\u6210\u7684 agentId \u4F1A\u5E26\u4E0AappName
\u7684\u524D\u7F00\u3002
\u6BD4\u5982\u5728\u52A0\u4E0A\u542F\u52A8\u53C2\u6570\uFF1Aas.sh --tunnel-server 'ws://127.0.0.1:7777/ws' --app-name demoapp
\uFF0C\u5219\u751F\u6210\u7684 agentId \u53EF\u80FD\u662Fdemoapp_URJZ5L48RPBR2ALI5K4V
\u3002
Tunnel server \u4F1A\u4EE5_
\u505A\u5206\u9694\u7B26\uFF0C\u63D0\u53D6\u51FAappName
\uFF0C\u65B9\u4FBF\u6309\u5E94\u7528\u8FDB\u884C\u7BA1\u7406\u3002
\u63D0\u793A
\u53E6\u5916\uFF0C\u4E5F\u53EF\u4EE5\u5728\u89E3\u538B\u7684 arthas \u76EE\u5F55\u4E0B\u7684 arthas.properties
\uFF0C\u6216\u8005\u5728 spring boot \u5E94\u7528\u7684application.properties
\u91CC\u914D\u7F6EappName
\u3002
\u5728\u672C\u5730\u542F\u52A8 tunnel-server\uFF0C\u7136\u540E\u4F7F\u7528as.sh
attach\uFF0C\u5E76\u4E14\u6307\u5B9A\u5E94\u7528\u540D--app-name test
\uFF1A
$ as.sh --tunnel-server 'ws://127.0.0.1:7777/ws' --app-name test
telnet connecting to arthas server... current timestamp is 1627539688
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
,---. ,------. ,--------.,--. ,--. ,---. ,---.
/ O \\ | .--. ''--. .--'| '--' | / O \\ ' .-'
| .-. || '--'.' | | | .--. || .-. |\`. \`-.
| | | || |\\ \\ | | | | | || | | |.-' |
\`--' \`--'\`--' '--' \`--' \`--' \`--'\`--' \`--'\`-----'
wiki https://arthas.aliyun.com/doc
tutorials https://arthas.aliyun.com/doc/arthas-tutorials.html
version 3.5.3
main_class demo.MathGame
pid 65825
time 2021-07-29 14:21:29
id test_PE3LZO9NA9ENJYTPGL9L
\u7136\u540E\u8BBF\u95EE tunnel-server\uFF0C\u53EF\u4EE5\u770B\u5230\u6240\u6709\u8FDE\u63A5\u7684\u5E94\u7528\u5217\u8868\uFF1A
`,3),oe={href:"http://localhost:8080/apps.html",target:"_blank",rel:"noopener noreferrer"},ce=s("http://localhost:8080/apps.html"),de=e("p",null,[e("img",{src:o,alt:""})],-1),pe=e("p",null,"\u518D\u6253\u5F00\u8BE6\u60C5\uFF0C\u5219\u53EF\u4EE5\u770B\u5230\u8FDE\u63A5\u7684\u6240\u6709 agent \u5217\u8868\uFF1A",-1),he={href:"http://localhost:8080/agents.html?app=test",target:"_blank",rel:"noopener noreferrer"},ue=s("http://localhost:8080/agents.html?app=test"),ve=t('\u63D0\u793A
\u5F3A\u70C8\u5EFA\u8BAE\u4E0D\u8981\u628A tunnel server \u76F4\u63A5\u66B4\u9732\u5230\u516C\u7F51\u4E0A\u3002
\u76EE\u524D tunnel server \u6CA1\u6709\u4E13\u95E8\u7684\u6743\u9650\u7BA1\u7406
\u5982\u679C\u5E0C\u671B\u90E8\u7F72\u591A\u53F0 tunnel server\uFF0C\u53EF\u4EE5\u901A\u8FC7 nginx \u505A\u8F6C\u53D1\uFF0Credis \u6765\u4FDD\u5B58 agent \u4FE1\u606F\u3002
ip_hash
\u3002browser <-> arthas tunnel server <-> arthas tunnel client <-> arthas agent