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/user-question-history11810....

3 lines
7.0 KiB
JavaScript

import{_ as d,o as h,c as i,b as t,w as r,a as o,d as _,e,r as c}from"./app.5024572d.js";const l={},u=_(`<h2 id="\u7528\u6237\u95EE\u9898" tabindex="-1"><a class="header-anchor" href="#\u7528\u6237\u95EE\u9898" aria-hidden="true">#</a> \u7528\u6237\u95EE\u9898 \uFF1A</h2><p>arthas\u67E5\u770B\u65B9\u6CD5\u8017\u65F6</p><hr><h2 id="\u4E13\u5BB6\u5B98\u65B9\u89E3\u7B54" tabindex="-1"><a class="header-anchor" href="#\u4E13\u5BB6\u5B98\u65B9\u89E3\u7B54" aria-hidden="true">#</a> \u4E13\u5BB6\u5B98\u65B9\u89E3\u7B54 \uFF1A</h2><p>\u8981\u4F7F\u7528Arthas\u6765\u67E5\u770B\u65B9\u6CD5\u7684\u8017\u65F6\uFF0C\u53EF\u4EE5\u4F9D\u636E\u63D0\u4F9B\u7684\u77E5\u8BC6\u8FDB\u884C\u4EE5\u4E0B\u64CD\u4F5C\uFF1A</p><ol><li><p><strong>\u542F\u52A8Arthas\u5E76\u8FDE\u63A5\u5230\u76EE\u6807Java\u8FDB\u7A0B</strong><br> \u9996\u5148\uFF0C\u4F60\u9700\u8981\u542F\u52A8Arthas\u5DE5\u5177\u5E76\u8FDE\u63A5\u5230\u4F60\u60F3\u8981\u76D1\u63A7\u7684Java\u5E94\u7528\u7A0B\u5E8F\u3002\u5728\u547D\u4EE4\u884C\u4E2D\uFF0C\u8FD0\u884CArthas\u7684\u542F\u52A8\u811A\u672C\uFF08\u4F8B\u5982\u5728Mac\u6216Linux\u73AF\u5883\u4E0B\u901A\u5E38\u662F<code>./as.sh</code>\uFF09\uFF0C\u7136\u540E\u4ECE\u5217\u51FA\u7684Java\u8FDB\u7A0B\u4E2D\u9009\u62E9\u4F60\u8981\u9644\u52A0\uFF08attach\uFF09\u7684\u8FDB\u7A0BID\u3002</p></li><li><p><strong>\u4F7F\u7528<code>trace</code>\u547D\u4EE4\u76D1\u63A7\u65B9\u6CD5\u8017\u65F6</strong><br> \u63A5\u7740\uFF0C\u5229\u7528Arthas\u7684<code>trace</code>\u547D\u4EE4\u6765\u81EA\u52A8\u9AD8\u4EAE\u663E\u793A\u6700\u8017\u65F6\u7684\u65B9\u6CD5\u8C03\u7528\u3002\u8FD9\u4E00\u6B65\u9AA4\u53EF\u4EE5\u5E2E\u52A9\u4F60\u5FEB\u901F\u5B9A\u4F4D\u5230\u54EA\u4E9B\u65B9\u6CD5\u6267\u884C\u65F6\u95F4\u6700\u957F\uFF0C\u53EF\u80FD\u662F\u6027\u80FD\u74F6\u9888\u6240\u5728\u3002\u4F8B\u5982\uFF0C\u5982\u679C\u4F60\u60F3\u76D1\u63A7<code>com.example.YourService</code>\u7C7B\u4E2D\u7684<code>yourMethod</code>\u65B9\u6CD5\uFF0C\u53EF\u4EE5\u8F93\u5165\u4EE5\u4E0B\u547D\u4EE4\uFF1A</p><div class="language-text ext-text line-numbers-mode"><pre class="language-text"><code>trace com.example.YourService yourMethod
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div><p>Arthas\u5C06\u4F1A\u5F00\u59CB\u8DDF\u8E2A\u8BE5\u65B9\u6CD5\u53CA\u5176\u8C03\u7528\u94FE\u8DEF\uFF0C\u5E76\u663E\u793A\u6BCF\u4E2A\u8C03\u7528\u7684\u8017\u65F6\u60C5\u51B5\uFF0C\u5982\u65B9\u6CD5\u6267\u884C\u6B21\u6570\u3001\u603B\u8017\u65F6\u548C\u5E73\u5747\u8017\u65F6\u7B49\u3002</p></li><li><p><strong>\u5206\u6790\u7ED3\u679C</strong><br> \u6267\u884C\u4E0A\u8FF0\u547D\u4EE4\u540E\uFF0CArthas\u4F1A\u8F93\u51FA\u76D1\u63A7\u5230\u7684\u65B9\u6CD5\u8C03\u7528\u4FE1\u606F\uFF0C\u5305\u62EC\u6BCF\u6B21\u8C03\u7528\u7684\u5165\u53C2\u3001\u8FD4\u56DE\u503C\u4EE5\u53CA\u6267\u884C\u65F6\u95F4\u7B49\u3002\u901A\u8FC7\u8FD9\u4E9B\u6570\u636E\uFF0C\u4F60\u53EF\u4EE5\u5206\u6790\u51FA\u54EA\u4E2A\u65B9\u6CD5\u8C03\u7528\u6700\u4E3A\u8017\u65F6\uFF0C\u4ECE\u800C\u4F5C\u4E3A\u6027\u80FD\u4F18\u5316\u7684\u5207\u5165\u70B9\u3002</p></li></ol><p>\u6839\u636E\u63D0\u4F9B\u7684\u77E5\u8BC6\uFF0C\u867D\u7136\u6CA1\u6709\u76F4\u63A5\u5C55\u793A<code>trace</code>\u547D\u4EE4\u7684\u5177\u4F53\u8F93\u51FA\u6837\u5F0F\uFF0C\u4F46\u7B2C\u4E00\u7BC7\u53C2\u8003\u5185\u5BB9\u63D0\u5230\u4E86<code>trace</code>\u547D\u4EE4\u73B0\u5728\u4F1A\u81EA\u52A8\u663E\u793A\u65B9\u6CD5\u7684\u8C03\u7528\u8017\u65F6\u60C5\u51B5\uFF0C\u8FD9\u6697\u793A\u4E86\u5176\u5F3A\u5927\u7684\u6027\u80FD\u5206\u6790\u80FD\u529B\u3002</p><p><strong>\u6CE8\u610F</strong>\uFF1A\u5982\u679C\u5728\u4F7F\u7528\u8FC7\u7A0B\u4E2D\u9047\u5230\u6D4F\u89C8\u5668\u67E5\u770B<code>arthas-output</code>\u4E0B\u7684profiler\u7ED3\u679C\u7684\u9700\u6C42\uFF08\u5982\u7B2C\u4E8C\u7BC7\u53C2\u8003\u5185\u5BB9\u6240\u8FF0\uFF09\uFF0C\u53EF\u4EE5\u901A\u8FC7\u8BBF\u95EE<code>http://localhost:3658/arthas-output/</code>\uFF08\u5047\u8BBEArthas\u4F7F\u7528\u7684\u9ED8\u8BA4\u7AEF\u53E3\u4E3A3658\uFF09\u6765\u83B7\u53D6\u66F4\u76F4\u89C2\u7684\u56FE\u5F62\u5316\u5206\u6790\u7ED3\u679C\u3002\u8FD9\u5BF9\u4E8E\u7406\u89E3\u590D\u6742\u8C03\u7528\u94FE\u8DEF\u548C\u6027\u80FD\u74F6\u9888\u5C24\u5176\u6709\u5E2E\u52A9\uFF0C\u5C3D\u7BA1\u8FD9\u4E00\u6B65\u4E0D\u662F\u76F4\u63A5\u5982\u4F55\u67E5\u770B\u65B9\u6CD5\u8017\u65F6\uFF0C\u4F46\u53EF\u4EE5\u4F5C\u4E3A\u8F85\u52A9\u624B\u6BB5\u6DF1\u5165\u5206\u6790\u6027\u80FD\u95EE\u9898\u3002</p><p>\u7EFC\u4E0A\uFF0C\u901A\u8FC7Arthas\u7684<code>trace</code>\u547D\u4EE4\u7ED3\u5408\u5176web\u754C\u9762\u8F93\u51FA\u7684profiler\u7ED3\u679C\uFF0C\u4F60\u53EF\u4EE5\u6709\u6548\u5730\u8BC6\u522B\u5E76\u5206\u6790Java\u5E94\u7528\u4E2D\u7684\u65B9\u6CD5\u8017\u65F6\u95EE\u9898\uFF0C\u8FDB\u800C\u91C7\u53D6\u63AA\u65BD\u8FDB\u884C\u4F18\u5316\u3002</p>`,9),p=e("---------------"),f=o("h2",{id:"\u53C2\u8003\u94FE\u63A5",tabindex:"-1"},[o("a",{class:"header-anchor",href:"#\u53C2\u8003\u94FE\u63A5","aria-hidden":"true"},"#"),e(" \u53C2\u8003\u94FE\u63A5 \uFF1A")],-1),m=e("Arthas3.0 \u7684\u65B0\u7279\u6027"),x=e("profiler"),b=e("\u4E13\u5BB6\u7ECF\u9A8C\uFF1A\u5229\u7528Arthas\u6392\u67E5NoSuchMethodError"),v=e("---------------"),g={id:"\u7B54\u7591\u670D\u52A1\u8BF4\u660E",tabindex:"-1"},A=o("a",{class:"header-anchor",href:"#\u7B54\u7591\u670D\u52A1\u8BF4\u660E","aria-hidden":"true"},"#",-1),k=e(),y=e("\u7B54\u7591\u670D\u52A1\u8BF4\u660E\uFF1A"),F=e("\u672C\u5185\u5BB9\u7ECF\u7531\u6280\u672F\u4E13\u5BB6\u5BA1\u9605\u7684\u7528\u6237\u95EE\u7B54\u7684\u955C\u50CF\u751F\u6210\uFF0C\u6211\u4EEC\u63D0\u4F9B\u4E86"),J=e("\u4E13\u5BB6\u667A\u80FD\u7B54\u7591\u670D\u52A1"),E=e("\uFF0C\u5728"),I=e("\u9875\u9762\u7684\u53F3\u4E0B\u7684\u6D6E\u7A97\u201D\u4E13\u5BB6\u7B54\u7591\u201C"),L=e("\u3002\u60A8\u4E5F\u53EF\u4EE5\u8BBF\u95EE : "),N={href:"https://answer.opensource.alibaba.com/docs/intro",target:"_blank",rel:"noopener noreferrer"},w=e("\u5168\u5C40\u4E13\u5BB6\u7B54\u7591"),B=e(" \u3002 \u54A8\u8BE2\u5176\u4ED6\u4EA7\u54C1\u7684\u7684\u95EE\u9898"),M=o("h3",{id:"\u53CD\u9988",tabindex:"-1"},[o("a",{class:"header-anchor",href:"#\u53CD\u9988","aria-hidden":"true"},"#"),e(" \u53CD\u9988")],-1),O=e("\u5982\u95EE\u7B54\u6709\u9519\u6F0F\uFF0C\u6B22\u8FCE\u