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/start-arthas.html

311 lines
10 KiB
HTML

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<!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 &mdash; Arthas 3.1.2 文档</title>
<link rel="shortcut icon" href="_static/favicon.ico"/>
<script type="text/javascript" src="_static/js/modernizr.min.js"></script>
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></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/language_data.js"></script>
<script type="text/javascript" src="_static/translations.js"></script>
<script type="text/javascript" src="_static/js/theme.js"></script>
<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>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.13.1/styles/github.min.css">
</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.1.2
</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 external" href="https://alibaba.github.io/arthas/en/">English Docs</a></li>
<li class="toctree-l1"><a class="reference external" href="https://alibaba.github.io/arthas/arthas-tutorials?language=cn">在线教程(推荐)</a></li>
<li class="toctree-l1"><a class="reference internal" href="install-detail.html">安装</a></li>
<li class="toctree-l1"><a class="reference internal" href="download.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 internal" href="web-console.html">WebConsole</a></li>
<li class="toctree-l1"><a class="reference internal" href="docker.html">Docker</a></li>
<li class="toctree-l1"><a class="reference external" href="https://github.com/alibaba/arthas/issues?q=label%3Auser-case">用户案例</a></li>
<li class="toctree-l1"><a class="reference external" href="https://github.com/alibaba/arthas/issues?q=label%3Aquestion-answered">常见问题</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/blob/master/CONTRIBUTING">编译调试/参与贡献</a></li>
<li class="toctree-l1"><a class="reference external" href="https://github.com/alibaba/arthas/releases">Release Notes</a></li>
<li class="toctree-l1"><a class="reference internal" href="contact-us.html">QQ群/钉钉群</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> &raquo;</li>
<li>启动 Arthas</li>
<li class="wy-breadcrumbs-aside">
<a href="https://github.com/alibaba/arthas/blob/master/site/src/site/sphinx/start-arthas.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">
<h1>启动 Arthas<a class="headerlink" href="#arthas" title="永久链接至标题"></a></h1>
<div class="section" id="id1">
<h2>交互模式启动<a class="headerlink" href="#id1" title="永久链接至标题"></a></h2>
<div class="highlight-bash notranslate"><div class="highlight hljs"><pre class="bash">./as.sh</pre></div>
</div>
<div class="highlight-bash notranslate"><div class="highlight hljs"><pre class="bash">➜ bin git:(develop) ✗ ./as.sh
Found existing java process, please choose one and hit RETURN.
[1]: 3088 org.jetbrains.idea.maven.server.RemoteMavenServer
* [2]: 12872 org.apache.catalina.startup.Bootstrap
[3]: 2455
Attaching to 12872...
,---. ,------. ,--------.,--. ,--. ,---. ,---.
/ O \ | .--. &#x27;&#x27;--. .--&#x27;| &#x27;--&#x27; | / O \ &#x27; .-&#x27;
| .-. || &#x27;--&#x27;.&#x27; | | | .--. || .-. |`. `-.
| | | || |\ \ | | | | | || | | |.-&#x27; |
`--&#x27; `--&#x27;`--&#x27; &#x27;--&#x27; `--&#x27; `--&#x27; `--&#x27;`--&#x27; `--&#x27;`-----&#x27;
$</pre></div>
</div>
</div>
<div class="section" id="id2">
<h2>非交互模式启动<a class="headerlink" href="#id2" title="永久链接至标题"></a></h2>
<p>启动脚本如下:</p>
<div class="highlight-bash notranslate"><div class="highlight hljs"><pre class="bash">./as.sh &lt;PID&gt;[@IP:PORT]</pre></div>
</div>
<div class="section" id="id3">
<h3>参数说明<a class="headerlink" href="#id3" title="永久链接至标题"></a></h3>
<ul class="simple">
<li><p>PID目标 Java 进程 ID请确保执行当前执行命令的用户必须有足够的权限操作对应的 Java 进程)</p></li>
<li><p>IPArthas Server 侦听的地址,默认值是 <code class="docutils literal notranslate"><span class="pre">127.00.1</span></code>。Arthas允许多个用户同时访问并且各自的命令不会相互干扰执行</p></li>
<li><p>PORT目标服务器 Arthas Server 的端口号,默认的端口号是 3658</p></li>
</ul>
</div>
<div class="section" id="id4">
<h3>示例<a class="headerlink" href="#id4" title="永久链接至标题"></a></h3>
<ul>
<li><p>如果不指定 IP 和 PORT默认是 127.0.0.1 和 3658</p>
<blockquote>
<div><p>./as.sh 12345</p>
</div></blockquote>
<p>上述命令等价于:</p>
<blockquote>
<div><p>./as.sh 12356&#64;127.0.0.1:3658</p>
</div></blockquote>
</li>
</ul>
</div>
<div class="section" id="id5">
<h3>远程诊断<a class="headerlink" href="#id5" title="永久链接至标题"></a></h3>
<p>服务器启动 Arthas Server 后,其他人可以使用 telnet 远程连接上去进程诊断,例如:</p>
<div class="highlight-bash notranslate"><div class="highlight hljs"><pre class="bash">telnet 192.168.1.119 3658</pre></div>
</div>
</div>
<div class="section" id="sudo">
<h3>sudo 支持<a class="headerlink" href="#sudo" title="永久链接至标题"></a></h3>
<p>成熟的线上管理环境一般都不会直接开放 JVM 部署用户权限给你,而是通过 sudo-list 来控制和监控用户的越权操作。由于 as.sh 脚本中会对当前用户的环境变量产生感知,所以需要加上 -H 参数</p>
<div class="highlight-bash notranslate"><div class="highlight hljs"><pre class="bash">sudo -u admin -H ./as.sh 12345</pre></div>
</div>
</div>
<div class="section" id="windows">
<h3>Windows 环境支持<a class="headerlink" href="#windows" title="永久链接至标题"></a></h3>
<p>目前<code class="docutils literal notranslate"><span class="pre">as.bat</span></code>脚本只支持一个参数pid</p>
<div class="highlight-bash notranslate"><div class="highlight hljs"><pre class="bash">as.bat &lt;pid&gt;</pre></div>
</div>
</div>
</div>
</div>
</div>
</div>
<footer>
<hr/>
<div role="contentinfo">
<p>
&copy; Copyright 2018-2019, 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">
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" target="_blank">Fork me at GitHub</a>
</div>
</div>
<script type="text/javascript" src="_static/add_badges.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.13.1/highlight.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlightjs-line-numbers.js/2.5.0/highlightjs-line-numbers.min.js"></script>
<script>
document.querySelectorAll('div.hljs > pre').forEach(function(block) {
hljs.highlightBlock(block);
hljs.lineNumbersBlock(block);
});
</script>
<script>
var _hmt = _hmt || [];
(function() {
var hm = document.createElement("script");
hm.src = "https://hm.baidu.com/hm.js?d5c5e25b100f0eb51a4c35c8a86ea9b4";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
</script>
</body>
</html>