update doc

This commit is contained in:
hengyunabc committed 2020-09-22 14:13:20 +08:00
1 parent 5ccb3e21a4
commit c1dcc8ff9e
12 files changed
+397 -4

No files matched your search

+55
View File
@@ -1,6 +1,61 @@
Docker
===
## Use JDK in Docker
Many times, the problem that arthas can't work with the application in docker is because the docker does not install JDK, but installs JRE. If only JRE is installed, many JAVA command line tools and class libraries will be missing, and Arthas will not work properly. Here are two common ways to use JDK in Docker.
### Use public JDK image
* https://hub.docker.com/_/openjdk/
such as:
```
FROM openjdk:8-jdk
```
or:
```
FROM openjdk:8-jdk-alpine
```
### Install via package management software
such as:
```bash
# Install OpenJDK-8
RUN apt-get update && \
apt-get install -y openjdk-8-jdk && \
apt-get install -y ant && \
apt-get clean;
# Fix certificate issues
RUN apt-get update && \
apt-get install ca-certificates-java && \
apt-get clean && \
update-ca-certificates -f;
# Setup JAVA_HOME - useful for docker commandline
ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64/
RUN export JAVA_HOME
```
or:
```bash
RUN yum install -y \
java-1.8.0-openjdk \
java-1.8.0-openjdk-devel
ENV JAVA_HOME /usr/lib/jvm/java-1.8.0-openjdk/
RUN export JAVA_HOME
```
## Quick start with Docker
1. Delete the existing `arthas-demo` docker container (not necessary)
+46
View File
@@ -181,3 +181,49 @@ $ profiler version
Async-profiler 1.6 built on Sep 9 2019
Copyright 2019 Andrei Pangin
```
### Configure framebuf option
> If you encounter `[frame_buffer_overflow]` in the generated svg image, you need to increase the framebuf (the default value is 1'000'000), which can be configured explicitly, such as:
```bash
profiler start --framebuf 5000000
```
### Configure include/exclude to filter data
If the application is complex and generates a lot of content, and you want to focus on only part of the data, you can filter by include/exclude. such as
```bash
profiler start --include'java/*' --include'demo/*' --exclude'*Unsafe.park*'
```
> Both include/exclude support setting multiple values, but need to be configured at the end of the command line.
### Specify execution time
For example, if you want the profiler to automatically end after 300 seconds, you can specify it with the `-d`/`--duration` parameter:
```bash
profiler start --duration 300
```
### Generate jfr format result
> Note that jfr only supports configuration at `start`. If it is specified at `stop`, it will not take effect.
```
profiler start --file /tmp/test.jfr
```
The `file` parameter supports some variables:
* Timestamp: `--file /tmp/test-%t.jfr`
* Process ID: `--file /tmp/test-%p.jfr`
The generated results can be viewed with tools that support the jfr format. such as:
* JDK Mission Control: https://github.com/openjdk/jmc
* JProfiler: https://github.com/alibaba/arthas/issues/1416
+49
View File
@@ -108,6 +108,11 @@
<li class="toctree-l1"><a class="reference internal" href="web-console.html">WebConsole</a></li>
<li class="toctree-l1"><a class="reference internal" href="http-api.html">Http API</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">Docker</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#use-jdk-in-docker">Use JDK in Docker</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#use-public-jdk-image">Use public JDK image</a></li>
<li class="toctree-l3"><a class="reference internal" href="#install-via-package-management-software">Install via package management software</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="#quick-start-with-docker">Quick start with Docker</a></li>
<li class="toctree-l2"><a class="reference internal" href="#diagnose-the-java-process-in-docker">Diagnose the Java process in Docker</a></li>
<li class="toctree-l2"><a class="reference internal" href="#diagnose-the-java-process-in-the-container-in-k8s">Diagnose the Java process in the container in k8s</a></li>
@@ -190,6 +195,50 @@
<div class="section" id="docker">
<h1>Docker<a class="headerlink" href="#docker" title="Permalink to this headline"></a></h1>
<div class="section" id="use-jdk-in-docker">
<h2>Use JDK in Docker<a class="headerlink" href="#use-jdk-in-docker" title="Permalink to this headline"></a></h2>
<p>Many times, the problem that arthas can’t work with the application in docker is because the docker does not install JDK, but installs JRE. If only JRE is installed, many JAVA command line tools and class libraries will be missing, and Arthas will not work properly. Here are two common ways to use JDK in Docker.</p>
<div class="section" id="use-public-jdk-image">
<h3>Use public JDK image<a class="headerlink" href="#use-public-jdk-image" title="Permalink to this headline"></a></h3>
<ul class="simple">
<li><p>https://hub.docker.com/_/openjdk/</p></li>
</ul>
<p>such as:</p>
<div class="highlight-default notranslate"><pre class="literal-block">FROM openjdk:8-jdk</pre>
</div>
<p>or:</p>
<div class="highlight-default notranslate"><pre class="literal-block">FROM openjdk:8-jdk-alpine</pre>
</div>
</div>
<div class="section" id="install-via-package-management-software">
<h3>Install via package management software<a class="headerlink" href="#install-via-package-management-software" title="Permalink to this headline"></a></h3>
<p>such as:</p>
<div class="highlight-bash notranslate"><div class="highlight hljs"><pre class="bash"># Install OpenJDK-8
RUN apt-get update &amp;&amp; \
apt-get install -y openjdk-8-jdk &amp;&amp; \
apt-get install -y ant &amp;&amp; \
apt-get clean;
# Fix certificate issues
RUN apt-get update &amp;&amp; \
apt-get install ca-certificates-java &amp;&amp; \
apt-get clean &amp;&amp; \
update-ca-certificates -f;
# Setup JAVA_HOME - useful for docker commandline
ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64/
RUN export JAVA_HOME</pre></div>
</div>
<p>or:</p>
<div class="highlight-bash notranslate"><div class="highlight hljs"><pre class="bash">RUN yum install -y \
java-1.8.0-openjdk \
java-1.8.0-openjdk-devel
ENV JAVA_HOME /usr/lib/jvm/java-1.8.0-openjdk/
RUN export JAVA_HOME</pre></div>
</div>
</div>
</div>
<div class="section" id="quick-start-with-docker">
<h2>Quick start with Docker<a class="headerlink" href="#quick-start-with-docker" title="Permalink to this headline"></a></h2>
<ol>
+45
View File
@@ -145,6 +145,10 @@
<li class="toctree-l3"><a class="reference internal" href="#use-execute-action-to-execute-complex-commands">Use <code class="docutils literal notranslate"><span class="pre">execute</span></code> action to execute complex commands</a></li>
<li class="toctree-l3"><a class="reference internal" href="#view-all-supported-actions">View all supported actions</a></li>
<li class="toctree-l3"><a class="reference internal" href="#view-version">View version</a></li>
<li class="toctree-l3"><a class="reference internal" href="#configure-framebuf-option">Configure framebuf option</a></li>
<li class="toctree-l3"><a class="reference internal" href="#configure-include-exclude-to-filter-data">Configure include/exclude to filter data</a></li>
<li class="toctree-l3"><a class="reference internal" href="#specify-execution-time">Specify execution time</a></li>
<li class="toctree-l3"><a class="reference internal" href="#generate-jfr-format-result">Generate jfr format result</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="cat.html">cat</a></li>
@@ -406,6 +410,47 @@ Async-profiler 1.6 built on Sep 9 2019
Copyright 2019 Andrei Pangin</pre></div>
</div>
</div>
<div class="section" id="configure-framebuf-option">
<h2>Configure framebuf option<a class="headerlink" href="#configure-framebuf-option" title="Permalink to this headline"></a></h2>
<blockquote>
<div><p>If you encounter <code class="docutils literal notranslate"><span class="pre">[frame_buffer_overflow]</span></code> in the generated svg image, you need to increase the framebuf (the default value is 1’000’000), which can be configured explicitly, such as:</p>
</div></blockquote>
<div class="highlight-bash notranslate"><div class="highlight hljs"><pre class="bash">profiler start --framebuf 5000000</pre></div>
</div>
</div>
<div class="section" id="configure-include-exclude-to-filter-data">
<h2>Configure include/exclude to filter data<a class="headerlink" href="#configure-include-exclude-to-filter-data" title="Permalink to this headline"></a></h2>
<p>If the application is complex and generates a lot of content, and you want to focus on only part of the data, you can filter by include/exclude. such as</p>
<div class="highlight-bash notranslate"><div class="highlight hljs"><pre class="bash">profiler start --include&#x27;java/*&#x27; --include&#x27;demo/*&#x27; --exclude&#x27;*Unsafe.park*&#x27;</pre></div>
</div>
<blockquote>
<div><p>Both include/exclude support setting multiple values, but need to be configured at the end of the command line.</p>
</div></blockquote>
</div>
<div class="section" id="specify-execution-time">
<h2>Specify execution time<a class="headerlink" href="#specify-execution-time" title="Permalink to this headline"></a></h2>
<p>For example, if you want the profiler to automatically end after 300 seconds, you can specify it with the <code class="docutils literal notranslate"><span class="pre">-d</span></code>/<code class="docutils literal notranslate"><span class="pre">--duration</span></code> parameter:</p>
<div class="highlight-bash notranslate"><div class="highlight hljs"><pre class="bash">profiler start --duration 300</pre></div>
</div>
</div>
<div class="section" id="generate-jfr-format-result">
<h2>Generate jfr format result<a class="headerlink" href="#generate-jfr-format-result" title="Permalink to this headline"></a></h2>
<blockquote>
<div><p>Note that jfr only supports configuration at <code class="docutils literal notranslate"><span class="pre">start</span></code>. If it is specified at <code class="docutils literal notranslate"><span class="pre">stop</span></code>, it will not take effect.</p>
</div></blockquote>
<div class="highlight-default notranslate"><pre class="literal-block">profiler start --file /tmp/test.jfr</pre>
</div>
<p>The <code class="docutils literal notranslate"><span class="pre">file</span></code> parameter supports some variables:</p>
<ul class="simple">
<li><p>Timestamp: <code class="docutils literal notranslate"><span class="pre">--file</span> <span class="pre">/tmp/test-%t.jfr</span></code></p></li>
<li><p>Process ID: <code class="docutils literal notranslate"><span class="pre">--file</span> <span class="pre">/tmp/test-%p.jfr</span></code></p></li>
</ul>
<p>The generated results can be viewed with tools that support the jfr format. such as:</p>
<ul class="simple">
<li><p>JDK Mission Control: https://github.com/openjdk/jmc</p></li>
<li><p>JProfiler: https://github.com/alibaba/arthas/issues/1416</p></li>
</ul>
</div>
</div>
+1 -1
View File
@@ -1 +1 @@
Search.setIndex({docnames:["README","advanced-use","advice-class","agent","arthas-properties","async","batch-support","cat","classloader","commands","contact-us","dashboard","docker","download","dump","echo","getstatic","grep","groovy","heapdump","http-api","idea-plugin","index","install-detail","jad","jvm","keymap","logger","manual-install","mbean","mc","monitor","ognl","options","perfcounter","profiler","pwd","quick-start","redefine","release-notes","reset","save-log","sc","sm","spring-boot-starter","stack","start-arthas","sysenv","sysprop","tee","thread","trace","tt","vmoption","watch","web-console"],envversion:{"sphinx.domains.c":1,"sphinx.domains.changeset":1,"sphinx.domains.citation":1,"sphinx.domains.cpp":1,"sphinx.domains.javascript":1,"sphinx.domains.math":2,"sphinx.domains.python":1,"sphinx.domains.rst":1,"sphinx.domains.std":1,sphinx:56},filenames:["README.md","advanced-use.md","advice-class.md","agent.md","arthas-properties.md","async.md","batch-support.md","cat.md","classloader.md","commands.md","contact-us.md","dashboard.md","docker.md","download.md","dump.md","echo.md","getstatic.md","grep.md","groovy.md","heapdump.md","http-api.md","idea-plugin.md","index.md","install-detail.md","jad.md","jvm.md","keymap.md","logger.md","manual-install.md","mbean.md","mc.md","monitor.md","ognl.md","options.md","perfcounter.md","profiler.md","pwd.md","quick-start.md","redefine.md","release-notes.md","reset.md","save-log.md","sc.md","sm.md","spring-boot-starter.md","stack.md","start-arthas.md","sysenv.md","sysprop.md","tee.md","thread.md","trace.md","tt.md","vmoption.md","watch.md","web-console.md"],objects:{},objnames:{},objtypes:{},terms:{"001018m":51,"004539m":51,"004935m":51,"005198m":51,"005372m":51,"005428m":51,"005778m":51,"006405m":51,"006783m":51,"008747m":51,"010317m":51,"010473m":51,"011636m":51,"012257m":51,"012416m":37,"013777m":51,"01696m":54,"019768m":51,"023715m":51,"028624m":51,"030432m":51,"033735m":51,"0353m":54,"03752m":51,"039s":1,"045534m":51,"05447m":51,"059839m":51,"061462m":51,"068692m":40,"06941m":51,"076457m":51,"078946m":51,"084025m":51,"08a":42,"094064m":51,"0_132":[24,37],"0_162":37,"0_51":48,"0_60":[8,11],"0m0":1,"0x0":47,"0x19":47,"0x1f5":47,"0x34":47,"0x4b67cf4d":52,"100m":[11,50,51],"100mb":27,"103m":11,"105228m":51,"10m":51,"1102230246251565e":[16,32,54],"113929m":51,"114m":11,"120s":31,"123934m":51,"128518m":40,"1294m":51,"12m":37,"136007m":37,"1365m":[11,37],"14dad5dc":40,"14m":[11,37],"155m":37,"16020s":11,"167786m":51,"167m":11,"168897m":54,"172m":11,"178583m":51,"1820m":[11,37],"182813m":51,"185203m":37,"1b6d3586":8,"200m":54,"202c":20,"20m":37,"223m":11,"232606m":51,"232887m":51,"234537m":51,"234m":11,"23m":37,"240m":[11,37],"241735m":20,"256color":47,"25s":33,"276874m":51,"277392m":54,"280502m":54,"281s":1,"28ea5898":32,"29fafb28":50,"2a139a55":27,"2b085b5d":20,"2bdd9114":24,"2eaa1027":[16,54],"2gb":27,"301ec38b":32,"303498m":54,"311395m":37,"31a6493":50,"327a647b":[30,38],"32m":37,"357742m":51,"3648e874":5,"389634m":51,"39m":11,"3d4eac69":[8,14,16,24,37,42,45,51],"3fe55d741882":55,"407b":20,"409446m":51,"414993m":54,"41cf53f9":54,"42ac":47,"42d3":20,"43de":20,"45df64fc":18,"46m":11,"472067c7":32,"473f":5,"477882m":54,"47m":11,"48f4":55,"492551m":51,"4a00":55,"4b85612c":32,"4c0df5f8":24,"4de6":21,"4rel":27,"522b4":42,"522b408a":54,"530255m":54,"546aeec1":50,"549379m":51,"572s":1,"587833m":54,"58ef25a97948":21,"590102m":40,"59m":11,"5ae4e5fbab8b4e529ac404f260d4e2d1_1":20,"5b0e2d00":18,"5e69":5,"5level":27,"60bc264d":47,"617465m":51,"6367e55a78a2":55,"65m":37,"66350f69":[8,14,24,37,42],"668m":11,"672m":37,"6849794470754667710l":24,"68b31f0a":8,"6951a712":24,"69ba0f27":50,"69dcaba4":24,"6cd0b6f8":50,"6e51ad67":24,"6fafc4c2":24,"701b744f971e":20,"7127ee12":50,"715367m":37,"716391m":51,"725be470":50,"7f89660b079b":5,"7f9a81e8":32,"838077m":51,"849713m":51,"852594m":51,"85m":37,"883b":20,"8b39":20,"8ecb9cb7c7804d5d92e258b23d5245cc_1":20,"8f7f6ad7bc2d4cb5aa57a530927a95cc_2":20,"94766d3c":20,"955dbd1325334a84972b0f3ac19de4f7_2":20,"961441m":54,"969732m":37,"98aee3ccbefb":20,"9eed":5,"9fa3":21,"\u4e2d\u6587\u6587\u6863":22,"boolean":[2,16,32,54],"break":[18,20],"byte":[1,24,25,39],"case":[2,5,17,22,39],"catch":[37,38],"char":[24,26],"class":[0,2,9,14,16,18,20,22,24,25,27,30,31,32,33,39,42,43,44,45,48,52,54],"default":[1,3,4,6,11,14,17,18,20,24,26,27,29,31,32,33,35,39,40,41,42,43,45,46,47,50,51,52,53,54,55],"enum":16,"export":34,"final":[2,6,24,37,50],"function":[20,33,37,38,51],"import":[22,24,37,44],"instanceof":52,"int":[24,37,38,42],"long":[16,20,24,27,32,45,51,54],"new":[20,24,35,37,38,50,51],"null":[2,5,8,14,20,27,32,37,54],"public":[2,8,18,24,37,38,42,43,44],"return":[0,1,2,18,20,22,31,32,36,37,38,43,52],"static":[1,16,18,24,32,37,38,39,42,44],"super":[8,24,42],"switch":[18,28,29,35],"throw":[2,18,24,37,38,39,51,52],"true":[2,4,11,12,20,24,27,33,37,38,41,42,48,50,51,52,53],"try":[0,1,12,20,22,28,37,38,50],"var":[6,19,47,48],"void":[2,18,24,37,38,44],"while":[14,16,18,20,Line truncated
Search.setIndex({docnames:["README","advanced-use","advice-class","agent","arthas-properties","async","batch-support","cat","classloader","commands","contact-us","dashboard","docker","download","dump","echo","getstatic","grep","groovy","heapdump","http-api","idea-plugin","index","install-detail","jad","jvm","keymap","logger","manual-install","mbean","mc","monitor","ognl","options","perfcounter","profiler","pwd","quick-start","redefine","release-notes","reset","save-log","sc","sm","spring-boot-starter","stack","start-arthas","sysenv","sysprop","tee","thread","trace","tt","vmoption","watch","web-console"],envversion:{"sphinx.domains.c":1,"sphinx.domains.changeset":1,"sphinx.domains.citation":1,"sphinx.domains.cpp":1,"sphinx.domains.javascript":1,"sphinx.domains.math":2,"sphinx.domains.python":1,"sphinx.domains.rst":1,"sphinx.domains.std":1,sphinx:56},filenames:["README.md","advanced-use.md","advice-class.md","agent.md","arthas-properties.md","async.md","batch-support.md","cat.md","classloader.md","commands.md","contact-us.md","dashboard.md","docker.md","download.md","dump.md","echo.md","getstatic.md","grep.md","groovy.md","heapdump.md","http-api.md","idea-plugin.md","index.md","install-detail.md","jad.md","jvm.md","keymap.md","logger.md","manual-install.md","mbean.md","mc.md","monitor.md","ognl.md","options.md","perfcounter.md","profiler.md","pwd.md","quick-start.md","redefine.md","release-notes.md","reset.md","save-log.md","sc.md","sm.md","spring-boot-starter.md","stack.md","start-arthas.md","sysenv.md","sysprop.md","tee.md","thread.md","trace.md","tt.md","vmoption.md","watch.md","web-console.md"],objects:{},objnames:{},objtypes:{},terms:{"001018m":51,"004539m":51,"004935m":51,"005198m":51,"005372m":51,"005428m":51,"005778m":51,"006405m":51,"006783m":51,"008747m":51,"010317m":51,"010473m":51,"011636m":51,"012257m":51,"012416m":37,"013777m":51,"01696m":54,"019768m":51,"023715m":51,"028624m":51,"030432m":51,"033735m":51,"0353m":54,"03752m":51,"039s":1,"045534m":51,"05447m":51,"059839m":51,"061462m":51,"068692m":40,"06941m":51,"076457m":51,"078946m":51,"084025m":51,"08a":42,"094064m":51,"0_132":[24,37],"0_162":37,"0_51":48,"0_60":[8,11],"0m0":1,"0x0":47,"0x19":47,"0x1f5":47,"0x34":47,"0x4b67cf4d":52,"100m":[11,50,51],"100mb":27,"103m":11,"105228m":51,"10m":51,"1102230246251565e":[16,32,54],"113929m":51,"114m":11,"120s":31,"123934m":51,"128518m":40,"1294m":51,"12m":37,"136007m":37,"1365m":[11,37],"14dad5dc":40,"14m":[11,37],"155m":37,"16020s":11,"167786m":51,"167m":11,"168897m":54,"172m":11,"178583m":51,"1820m":[11,37],"182813m":51,"185203m":37,"1b6d3586":8,"200m":54,"202c":20,"20m":37,"223m":11,"232606m":51,"232887m":51,"234537m":51,"234m":11,"23m":37,"240m":[11,37],"241735m":20,"256color":47,"25s":33,"276874m":51,"277392m":54,"280502m":54,"281s":1,"28ea5898":32,"29fafb28":50,"2a139a55":27,"2b085b5d":20,"2bdd9114":24,"2eaa1027":[16,54],"2gb":27,"301ec38b":32,"303498m":54,"311395m":37,"31a6493":50,"327a647b":[30,38],"32m":37,"357742m":51,"3648e874":5,"389634m":51,"39m":11,"3d4eac69":[8,14,16,24,37,42,45,51],"3fe55d741882":55,"407b":20,"409446m":51,"414993m":54,"41cf53f9":54,"42ac":47,"42d3":20,"43de":20,"45df64fc":18,"46m":11,"472067c7":32,"473f":5,"477882m":54,"47m":11,"48f4":55,"492551m":51,"4a00":55,"4b85612c":32,"4c0df5f8":24,"4de6":21,"4rel":27,"522b4":42,"522b408a":54,"530255m":54,"546aeec1":50,"549379m":51,"572s":1,"587833m":54,"58ef25a97948":21,"590102m":40,"59m":11,"5ae4e5fbab8b4e529ac404f260d4e2d1_1":20,"5b0e2d00":18,"5e69":5,"5level":27,"60bc264d":47,"617465m":51,"6367e55a78a2":55,"65m":37,"66350f69":[8,14,24,37,42],"668m":11,"672m":37,"6849794470754667710l":24,"68b31f0a":8,"6951a712":24,"69ba0f27":50,"69dcaba4":24,"6cd0b6f8":50,"6e51ad67":24,"6fafc4c2":24,"701b744f971e":20,"7127ee12":50,"715367m":37,"716391m":51,"725be470":50,"7f89660b079b":5,"7f9a81e8":32,"838077m":51,"849713m":51,"852594m":51,"85m":37,"883b":20,"8b39":20,"8ecb9cb7c7804d5d92e258b23d5245cc_1":20,"8f7f6ad7bc2d4cb5aa57a530927a95cc_2":20,"94766d3c":20,"955dbd1325334a84972b0f3ac19de4f7_2":20,"961441m":54,"969732m":37,"98aee3ccbefb":20,"9eed":5,"9fa3":21,"\u4e2d\u6587\u6587\u6863":22,"boolean":[2,16,32,54],"break":[18,20],"byte":[1,24,25,39],"case":[2,5,17,22,39],"catch":[37,38],"char":[24,26],"class":[0,2,9,12,14,16,18,20,22,24,25,27,30,31,32,33,39,42,43,44,45,48,52,54],"default":[1,3,4,6,11,14,17,18,20,24,26,27,29,31,32,33,35,39,40,41,42,43,45,46,47,50,51,52,53,54,55],"enum":16,"export":[12,34],"final":[2,6,24,37,50],"function":[20,33,37,38,51],"import":[22,24,37,44],"instanceof":52,"int":[24,37,38,42],"long":[16,20,24,27,32,45,51,54],"new":[20,24,35,37,38,50,51],"null":[2,5,8,14,20,27,32,37,54],"public":[2,8,18,24,37,38,42,43,44],"return":[0,1,2,18,20,22,31,32,36,37,38,43,52],"static":[1,16,18,24,32,37,38,39,42,44],"super":[8,24,42],"switch":[18,28,29,35],"throw":[2,18,24,37,38,39,51,52],"true":[2,4,11,12,20,24,27,33,37,38,41,42,48,50,51,52,53],"try":[0,1,12,20,22,28,37,38,50],"var":[6,19,47,48],"void":[2,18,24,37,38,44],"while":[14,1Line truncated