forked from alibaba/arthas
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHome.html
384 lines (265 loc) · 18.3 KB
/
Home.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="zh-CN" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="zh-CN" > <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Arthas 用户文档 — Arthas 3.0.1-RC-SNAPSHOT 文档</title>
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/overrides.css" type="text/css" />
<link rel="index" title="索引" href="genindex.html" />
<link rel="search" title="搜索" href="search.html" />
<script src="_static/center_page.js"></script>
<script src="_static/js/modernizr.min.js"></script>
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search">
<a href="index.html" class="icon icon-home"> Arthas
</a>
<div class="version">
3.0.1-RC-SNAPSHOT
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
<input type="text" name="q" placeholder="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<ul>
<li class="toctree-l1"><a class="reference internal" href="install-detail.html">安装</a></li>
<li class="toctree-l1"><a class="reference internal" href="quick-start.html">快速入门</a></li>
<li class="toctree-l1"><a class="reference internal" href="advanced-use.html">进阶使用</a></li>
<li class="toctree-l1"><a class="reference internal" href="commands.html">命令列表</a></li>
<li class="toctree-l1"><a class="reference external" href="https://github.com/alibaba/arthas/labels/user-case">用户案例</a></li>
<li class="toctree-l1"><a class="reference internal" href="release-notes.html">Release Notes</a></li>
<li class="toctree-l1"><a class="reference external" href="https://github.com/alibaba/arthas/labels/question-answered">Questions and answers</a></li>
<li class="toctree-l1"><a class="reference external" href="https://github.com/alibaba/arthas">Fork me at GitHub</a></li>
<li class="toctree-l1"><a class="reference external" href="https://github.com/alibaba/arthas/CONTRIBUTING.md">参与贡献</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="index.html">Arthas</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="index.html">Docs</a> »</li>
<li>Arthas 用户文档</li>
<li class="wy-breadcrumbs-aside">
<a href="https://github.com/alibaba/arthas/blob/master/site/src/site/sphinx/Home.md" class="fa fa-github"> Edit on GitHub</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="arthas">
<span id="arthas"></span><h1>Arthas 用户文档<a class="headerlink" href="#arthas" title="永久链接至标题">¶</a></h1>
<div class="section" id="arthas">
<span id="id1"></span><h2>Arthas(阿尔萨斯) 能为你做什么?<a class="headerlink" href="#arthas" title="永久链接至标题">¶</a></h2>
<p>当你遇到以下类似问题而束手无策时,你看到了这篇文档,看到了 <code class="docutils literal notranslate"><span class="pre">Arthas</span></code>,那么恭喜你,你朝正确的方向又迈了一大步。</p>
<ol class="simple">
<li>这个类从哪个 jar 包加载的?为什么会报各种类相关的 Exception?</li>
<li>我改的代码为什么没有执行到?难道是我没 commit?分支搞错了?</li>
<li>遇到问题无法在预发 debug 一下,难道只能通过加日志再重新预发布吗?</li>
<li>线上遇到某个用户的数据处理有问题,但线上同样无法 debug,线下无法重现!</li>
<li>是否有一个全局视角来查看系统的运行状况?</li>
<li>有什么办法可以监控到容器和中间件(AliTomcat、HSF、Notify 等)的实时运行状态?</li>
</ol>
<p><code class="docutils literal notranslate"><span class="pre">Arthas</span></code> 是全新的在线诊断工具,采用命令行交互模式,支持web端在线诊断,同时提供丰富的 <code class="docutils literal notranslate"><span class="pre">Tab</span></code> 自动补全功能,进一步方便进行问题的定位和诊断。</p>
</div>
<div class="section" id="release-notes">
<span id="release-notes"></span><h2><a class="reference external" href="https://github.com/alibaba/arthas/tree/master/site/src/site/sphinx/release-notes">Release Notes</a><a class="headerlink" href="#release-notes" title="永久链接至标题">¶</a></h2>
</div>
<div class="section" id="arthas">
<span id="id2"></span><h2>Arthas 安装及使用<a class="headerlink" href="#arthas" title="永久链接至标题">¶</a></h2>
<div class="section" id="">
<span id="id3"></span><h3>1. 在线诊断<a class="headerlink" href="#" title="永久链接至标题">¶</a></h3>
<p>TODO</p>
</div>
<div class="section" id="arthas">
<span id="id4"></span><h3>2. 通过脚本使用Arthas<a class="headerlink" href="#arthas" title="永久链接至标题">¶</a></h3>
<ul class="simple">
<li>下载脚本</li>
</ul>
<div class="section" id="mac-linux">
<span id="mac-linux"></span><h4>MAC/Linux<a class="headerlink" href="#mac-linux" title="永久链接至标题">¶</a></h4>
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>curl -L TODO /install.sh <span class="p">|</span> sh
</pre></div>
</div>
</div>
<div class="section" id="windows">
<span id="windows"></span><h4>Windows<a class="headerlink" href="#windows" title="永久链接至标题">¶</a></h4>
<p>点击 <a class="reference external" href="https://github.com/alibaba/arthas/tree/master/site/src/site/sphinx/TODO">下载</a> 最新zip包</p>
<blockquote>
<div>如遇无法下载,请参考<a class="reference external" href="https://github.com/alibaba/arthas/tree/master/site/src/site/sphinx/install-detail">这里</a></div></blockquote>
<ul class="simple">
<li>启动 Arthas</li>
</ul>
<p><code class="docutils literal notranslate"><span class="pre">./as.sh</span></code></p>
<p>执行该脚本的用户需要和目标进程具有相同的权限。比如以<code class="docutils literal notranslate"><span class="pre">admin</span></code>用户来执行:</p>
<p><code class="docutils literal notranslate"><span class="pre">sudo</span> <span class="pre">su</span> <span class="pre">admin</span> <span class="pre">&&</span> <span class="pre">./as.sh</span></code> 或 <code class="docutils literal notranslate"><span class="pre">sudo</span> <span class="pre">-u</span> <span class="pre">admin</span> <span class="pre">-EH</span> <span class="pre">./as.sh</span></code></p>
<p>详细的启动脚本说明,请参考<a class="reference external" href="https://github.com/alibaba/arthas/tree/master/site/src/site/sphinx/start-arthas">这里</a></p>
<p>如果attatch不上目标进程,可以查看<code class="docutils literal notranslate"><span class="pre">~/logs/arthas/</span></code> 目录下的日志。</p>
</div>
</div>
<div class="section" id="">
<span id="id5"></span><h3>3. 开启诊断之旅<a class="headerlink" href="#" title="永久链接至标题">¶</a></h3>
<p>为了使你快速找到适合你分析、诊断问题的命令,我们将 Arthas 的命令按问题的类型做了一个大的分类,如下:</p>
<div class="section" id="">
<span id="id6"></span><h4>想快速了解系统、应用运行状况<a class="headerlink" href="#" title="永久链接至标题">¶</a></h4>
<hr class="docutils" />
<ul class="simple">
<li><a class="reference external" href="https://github.com/alibaba/arthas/tree/master/site/src/site/sphinx/dashboard">dashboard</a>——当前系统的实时数据面板</li>
<li><a class="reference external" href="https://github.com/alibaba/arthas/tree/master/site/src/site/sphinx/thread">thread</a>——查看当前 JVM 的线程堆栈信息</li>
<li><a class="reference external" href="https://github.com/alibaba/arthas/tree/master/site/src/site/sphinx/jvm">jvm</a>——查看当前 JVM 的信息</li>
<li><a class="reference external" href="https://github.com/alibaba/arthas/tree/master/site/src/site/sphinx/sysprop">sysprop</a>——查看和修改JVM的系统属性</li>
<li><strong>New!</strong> <a class="reference external" href="https://github.com/alibaba/arthas/tree/master/site/src/site/sphinx/getstatic">getstatic</a>——查看类的静态属性</li>
</ul>
</div>
<div class="section" id="classclassloader">
<span id="classclassloader"></span><h4>类、方法冲突、class文件、classloader继承问题等<a class="headerlink" href="#classclassloader" title="永久链接至标题">¶</a></h4>
<hr class="docutils" />
<ul class="simple">
<li><a class="reference external" href="https://github.com/alibaba/arthas/tree/master/site/src/site/sphinx/sc">sc</a>——查看JVM已加载的类信息</li>
<li><a class="reference external" href="https://github.com/alibaba/arthas/tree/master/site/src/site/sphinx/sm">sm</a>——查看已加载类的方法信息</li>
<li><a class="reference external" href="https://github.com/alibaba/arthas/tree/master/site/src/site/sphinx/dump">dump</a>——dump 已加载类的 byte code 到特定目录</li>
<li><a class="reference external" href="https://github.com/alibaba/arthas/tree/master/site/src/site/sphinx/redefine">redefine</a>——加载外部的<code class="docutils literal notranslate"><span class="pre">.class</span></code>文件,redefine到JVM里</li>
<li><a class="reference external" href="https://github.com/alibaba/arthas/tree/master/site/src/site/sphinx/jad">jad</a>——反编译指定已加载类的源码</li>
<li><a class="reference external" href="https://github.com/alibaba/arthas/tree/master/site/src/site/sphinx/classloader">classloader</a>——查看classloader的继承树,urls,类加载信息,使用classloader去getResource</li>
</ul>
</div>
<div class="section" id="">
<span id="id7"></span><h4>查看方法执行参数、异常、返回值、调用路径等<a class="headerlink" href="#" title="永久链接至标题">¶</a></h4>
<blockquote>
<div>非常重要,请注意,这些命令,都通过字节码增强技术来实现的,会在指定类的方法中插入一些切面来实现数据统计和观测,因此在线上、预发使用时,请尽量明确需要观测的类、方法以及条件,诊断结束要执行 <code class="docutils literal notranslate"><span class="pre">shutdown</span></code> 或将增强过的类执行 <code class="docutils literal notranslate"><span class="pre">reset</span></code> 命令。</div></blockquote>
<ul class="simple">
<li><a class="reference external" href="https://github.com/alibaba/arthas/tree/master/site/src/site/sphinx/monitor">monitor</a>——方法执行监控</li>
<li><a class="reference external" href="https://github.com/alibaba/arthas/tree/master/site/src/site/sphinx/watch">watch</a>——方法执行数据观测</li>
<li><a class="reference external" href="https://github.com/alibaba/arthas/tree/master/site/src/site/sphinx/trace">trace</a>——方法内部调用路径,并输出方法路径上的每个节点上耗时</li>
<li><a class="reference external" href="https://github.com/alibaba/arthas/tree/master/site/src/site/sphinx/stack">stack</a>——输出当前方法被调用的调用路径</li>
<li><a class="reference external" href="https://github.com/alibaba/arthas/tree/master/site/src/site/sphinx/tt">tt</a>——方法执行数据的时空隧道,记录下指定方法每次调用的入参和返回信息,并能对这些不同的时间下调用进行观测</li>
</ul>
</div>
<div class="section" id="options">
<span id="options"></span><h4>options<a class="headerlink" href="#options" title="永久链接至标题">¶</a></h4>
<ul class="simple">
<li><a class="reference external" href="https://github.com/alibaba/arthas/tree/master/site/src/site/sphinx/options">options</a>——查看或设置Arthas全局开关</li>
</ul>
</div>
<div class="section" id="arthas">
<span id="id8"></span><h4>Arthas 基础命令<a class="headerlink" href="#arthas" title="永久链接至标题">¶</a></h4>
<ul class="simple">
<li>help——查看命令帮助信息</li>
<li>cls——清空当前屏幕区域</li>
<li>session——查看当前会话的信息</li>
<li><a class="reference external" href="https://github.com/alibaba/arthas/tree/master/site/src/site/sphinx/reset">reset</a>——重置增强类,将被 Arthas 增强过的类全部还原,Arthas 服务端关闭时会重置所有增强过的类</li>
<li>version——输出当前目标 Java 进程所加载的 Arthas 版本号</li>
<li>quit——退出当前 Arthas 客户端,其他 Arthas 客户端不受影响</li>
<li>shutdown——关闭 Arthas 服务端,所有 Arthas 客户端全部退出</li>
<li><a class="reference external" href="https://github.com/alibaba/arthas/tree/master/site/src/site/sphinx/keymap">keymap</a>——Arthas快捷键列表及自定义快捷键</li>
</ul>
</div>
<div class="section" id="">
<span id="id9"></span><h4>管道<a class="headerlink" href="#" title="永久链接至标题">¶</a></h4>
<p>Arthas支持使用管道对上述命令的结果进行进一步的处理,如<code class="docutils literal notranslate"><span class="pre">sm</span> <span class="pre">org.apache.log4j.Logger</span> <span class="pre">|</span> <span class="pre">grep</span> <span class="pre"><init></span></code></p>
<ul class="simple">
<li>grep——搜索满足条件的结果</li>
<li>plaintext——将命令的结果去除颜色</li>
<li>wc——按行统计输出结果</li>
</ul>
</div>
<div class="section" id="">
<span id="id10"></span><h4>后台异步任务<a class="headerlink" href="#" title="永久链接至标题">¶</a></h4>
<p>当线上出现偶发的问题,比如需要watch某个条件,而这个条件一天可能才会出现一次时,异步后台任务就派上用场了,详情请参考<a class="reference internal" href="async.html"><span class="doc">这里</span></a></p>
<ul class="simple">
<li>使用 > 将结果重写向到日志文件,使用 & 指定命令是后台运行,session断开不影响任务执行(生命周期默认为1天)</li>
<li>jobs——列出所有job</li>
<li>kill——强制终止任务</li>
<li>fg——将暂停的任务拉到前台执行</li>
<li>bg——将暂停的任务放到后台执行</li>
</ul>
</div>
</div>
<div class="section" id="faq">
<span id="faq"></span><h3>4. 常见问题及FAQ<a class="headerlink" href="#faq" title="永久链接至标题">¶</a></h3>
<p>TODO</p>
</div>
<div class="section" id="">
<span id="id11"></span><h3>5. 其他特性说明<a class="headerlink" href="#" title="永久链接至标题">¶</a></h3>
<div class="toctree-wrapper compound">
<ul>
<li class="toctree-l1"><a class="reference internal" href="async.html">异步命令支持</a></li>
<li class="toctree-l1"><a class="reference internal" href="options.html">执行结果存日志</a></li>
<li class="toctree-l1"><a class="reference internal" href="batch-support.html">批处理的支持</a></li>
<li class="toctree-l1"><a class="reference external" href="https://github.com/alibaba/arthas/tree/master/site/src/site/sphinx/TODO/articles/92448">ognl表达式的用法说明</a></li>
</ul>
</div>
</div>
<div class="section" id="">
<span id="id12"></span><h3>6. 用户使用案例<a class="headerlink" href="#" title="永久链接至标题">¶</a></h3>
<ul class="simple">
<li><a class="reference external" href="https://github.com/alibaba/arthas/tree/master/site/src/site/sphinx/usercase">用户使用案例</a></li>
<li>[Arthas——码农的才思与浪漫] TODO</li>
</ul>
<p>钉钉交流群号: TODO</p>
</div>
</div>
</div>
</div>
</div>
<footer>
<hr/>
<div role="contentinfo">
<p>
© Copyright 2018, Alibaba Middleware Group, and contributors.
</p>
</div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'3.0.1-RC-SNAPSHOT',
LANGUAGE:'zh_CN',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true,
SOURCELINK_SUFFIX: '.txt'
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="_static/translations.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<script type="text/javascript" src="_static/js/theme.js"></script>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
<div class="github-fork-ribbon-wrapper right">
<div class="github-fork-ribbon">
<a href="https://github.com/alibaba/arthas">Fork me at GitHub</a>
</div>
</div>
<script type="text/javascript" src="_static/add_badges.js"></script>
</body>
</html>