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

`,3),B=s("\u542F\u52A8\u4E4B\u540E\uFF0C\u53EF\u4EE5\u8BBF\u95EE "),D={href:"http://127.0.0.1:8080/",target:"_blank",rel:"noopener noreferrer"},C=s("http://127.0.0.1:8080/"),J=s(" \uFF0C\u518D\u901A\u8FC7"),O=e("code",null,"agentId",-1),P=s("\u8FDE\u63A5\u5230\u5DF2\u6CE8\u518C\u7684 arthas agent \u4E0A\u3002"),U=s("\u901A\u8FC7 Spring Boot \u7684 Endpoint\uFF0C\u53EF\u4EE5\u67E5\u770B\u5230\u5177\u4F53\u7684\u8FDE\u63A5\u4FE1\u606F\uFF1A "),G={href:"http://127.0.0.1:8080/actuator/arthas",target:"_blank",rel:"noopener noreferrer"},M=s("http://127.0.0.1:8080/actuator/arthas"),Z=s(" \uFF0C\u767B\u9646\u7528\u6237\u540D\u662F"),K=e("code",null,"arthas",-1),$=s("\uFF0C\u5BC6\u7801\u5728 arthas tunnel server \u7684\u65E5\u5FD7\u91CC\u53EF\u4EE5\u627E\u5230\uFF0C\u6BD4\u5982\uFF1A"),q=t(`
32851 [main] INFO  o.s.b.a.s.s.UserDetailsServiceAutoConfiguration

Using generated security password: f1dca050-3777-48f4-a577-6367e55a78a2

\u542F\u52A8 arthas \u65F6\u8FDE\u63A5\u5230 tunnel server

\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'

attach \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
`,11),F=s("\u4EE5\u4E0A\u9762\u7684\u4E3A\u4F8B\uFF0C\u5728\u6D4F\u89C8\u5668\u91CC\u8BBF\u95EE "),W={href:"http://47.75.156.201/arthas/?port=80",target:"_blank",rel:"noopener noreferrer"},Y=s("http://47.75.156.201/arthas/?port=80"),z=s(" \uFF0C\u8F93\u5165 "),H=e("code",null,"agentId",-1),Q=s("\uFF0C\u5C31\u53EF\u4EE5\u8FDE\u63A5\u5230\u672C\u673A\u4E0A\u7684 arthas \u4E86\u3002"),X=t('

\u6700\u4F73\u5B9E\u8DF5

\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

Tunnel Server \u7684\u7BA1\u7406\u9875\u9762

',8),ee={class:"custom-container tip"},se=e("p",{class:"custom-container-title"},"\u63D0\u793A",-1),ne=e("p",null,[s("\u9700\u8981\u5728 tunnel-server \u7684"),e("code",null,"application.properties"),s("\u91CC\u914D\u7F6E "),e("code",null,"arthas.enable-detail-pages=true"),s("\uFF0C\u4E5F\u53EF\u4EE5\u7528\u547D\u4EE4\u884C\u53C2\u6570\u6307\u5B9A\uFF1A "),e("code",null,"java -Darthas.enable-detail-pages=true -jar arthas-tunnel-server.jar")],-1),ae=s("\u652F\u6301\u7684\u914D\u7F6E\u9879\uFF1A "),te={href:"https://github.com/alibaba/arthas/blob/master/tunnel-server/src/main/resources/application.properties",target:"_blank",rel:"noopener noreferrer"},re=s("tunnel-server application.properties"),le=e("p",null,[e("strong",null,"\u6CE8\u610F\uFF0C\u5F00\u653E\u7BA1\u7406\u9875\u9762\u6709\u98CE\u9669\uFF01\u7BA1\u7406\u9875\u9762\u6CA1\u6709\u5B89\u5168\u62E6\u622A\u529F\u80FD\uFF0C\u52A1\u5FC5\u81EA\u884C\u589E\u52A0\u5B89\u5168\u63AA\u65BD\uFF0C\u4E0D\u8981\u5F00\u653E\u5230\u516C\u7F51\u3002")],-1),ie=t(`

\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('

\u5B89\u5168\u548C\u6743\u9650\u7BA1\u7406

\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

  1. \u7528\u6237\u9700\u8981\u81EA\u884C\u5F00\u53D1\uFF0C\u5BF9 app name \u9274\u6743\u3002
  2. \u5982\u679C\u5F00\u653E\u7BA1\u7406\u9875\u9762\uFF0C\u9700\u8981\u589E\u52A0\u5B89\u5168\u63AA\u65BD\u3002

\u96C6\u7FA4\u65B9\u5F0F\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

Arthas tunnel server \u7684\u5DE5\u4F5C\u539F\u7406

browser <-> arthas tunnel server <-> arthas tunnel client <-> arthas agent
`,10),_e={href:"https://github.com/alibaba/arthas/blob/master/tunnel-server/README.md#",target:"_blank",rel:"noopener noreferrer"},be=s("tunnel-server/README.md");function me(ge,ke){const r=i("RouterLink"),a=i("ExternalLinkIcon");return h(),u("div",null,[_,b,m,g,k,e("ul",null,[e("li",null,[f,n(r,{to:"/doc/web-console.html"},{default:l(()=>[x]),_:1})]),e("li",null,[w,n(r,{to:"/doc/spring-boot-starter.html"},{default:l(()=>[A]),_:1})])]),I,e("p",null,[e("a",E,[N,n(a)])]),e("ul",null,[e("li",null,[e("p",null,[R,e("a",L,[S,n(a)])])]),e("li",null,[e("p",null,[y,e("a",T,[V,n(a)])])])]),j,e("p",null,[B,e("a",D,[C,n(a)]),J,O,P]),e("p",null,[U,e("a",G,[M,n(a)]),Z,K,$]),q,e("p",null,[F,e("a",W,[Y,n(a)]),z,H,Q]),X,e("div",ee,[se,ne,e("p",null,[ae,e("a",te,[re,n(a)])]),le]),ie,e("p",null,[e("a",oe,[ce,n(a)])]),de,pe,e("p",null,[e("a",he,[ue,n(a)])]),ve,e("p",null,[e("a",_e,[be,n(a)])])])}const we=p(v,[["render",me],["__file","tunnel.html.vue"]]);export{we as default};