From bbb695ca81bace8f7915b6f7b6203354b737d8cd Mon Sep 17 00:00:00 2001 From: hengyunabc Date: Thu, 3 Sep 2020 16:30:01 +0800 Subject: [PATCH] add arthas-properties.md --- site/src/site/sphinx/advanced-use.md | 4 ++ site/src/site/sphinx/agent.md | 4 +- site/src/site/sphinx/arthas-properties.md | 40 +++++++++++++++++++ site/src/site/sphinx/en/advanced-use.md | 4 ++ site/src/site/sphinx/en/agent.md | 2 +- site/src/site/sphinx/en/arthas-properties.md | 38 ++++++++++++++++++ .../src/site/sphinx/en/spring-boot-starter.md | 1 + site/src/site/sphinx/spring-boot-starter.md | 1 + 8 files changed, 91 insertions(+), 3 deletions(-) create mode 100644 site/src/site/sphinx/arthas-properties.md create mode 100644 site/src/site/sphinx/en/arthas-properties.md diff --git a/site/src/site/sphinx/advanced-use.md b/site/src/site/sphinx/advanced-use.md index 23ef94031..b751cc77e 100644 --- a/site/src/site/sphinx/advanced-use.md +++ b/site/src/site/sphinx/advanced-use.md @@ -91,6 +91,10 @@ Arthas支持使用管道对上述命令的结果进行进一步的处理,如`s * [Web Console](web-console.md) +## Arthas Properties + +* [Arthas Properties](arthas-properties.md) + ## 以java agent方式启动 * [以java agent方式启动](agent.md) diff --git a/site/src/site/sphinx/agent.md b/site/src/site/sphinx/agent.md index a1ac03665..a606e75e6 100644 --- a/site/src/site/sphinx/agent.md +++ b/site/src/site/sphinx/agent.md @@ -9,7 +9,7 @@ java -javaagent:/tmp/test/arthas-agent.jar -jar arthas-demo.jar ``` -默认的配置项在解压目录里的`arthas.properties`文件里。 +默认的配置项在解压目录里的`arthas.properties`文件里。参考:[Arthas Properties](arthas-properties.md) -参考: https://docs.oracle.com/javase/8/docs/api/java/lang/instrument/package-summary.html \ No newline at end of file +Java Agent机制参考: https://docs.oracle.com/javase/8/docs/api/java/lang/instrument/package-summary.html \ No newline at end of file diff --git a/site/src/site/sphinx/arthas-properties.md b/site/src/site/sphinx/arthas-properties.md new file mode 100644 index 000000000..d7af00d38 --- /dev/null +++ b/site/src/site/sphinx/arthas-properties.md @@ -0,0 +1,40 @@ +Arthas Properties +=== + +`arthas.properties`文件在arthas的目录下。 + +* 如果是自动下载的arthas,则目录在`~/.arthas/lib/3.x.x/arthas/`下面 +* 如果是下载的完整包,在arthas解压目录下 + + +## 支持的配置项 + + + +``` +#arthas.config.overrideAll=true +arthas.telnetPort=3658 +arthas.httpPort=8563 +arthas.ip=localhost + +#arthas.tunnelServer=ws://127.0.0.1:7777/ws +#arthas.agentId=mmmmmmyiddddd +``` + +* 如果配置 `arthas.telnetPort`为 -1 ,则不listen telnet端口。`arthas.httpPort`类似。 +* 如果配置 `arthas.telnetPort`为 0 ,则随机telnet端口,在`~/logs/arthas/arthas.log`里可以找到具体端口日志。`arthas.httpPort`类似。 + + +> 如果是防止一个机器上启动多个 arthas端口冲突。可以配置为随机端口,或者配置为 -1,并且通过tunnel server来使用arthas。 + +## 配置的优先级 + +配置的优先级是:命令行参数 > System Env > System Properties > arthas.properties 。 + +比如: + +* `./as.sh --telnet-port 9999` 传入的配置会覆盖掉`arthas.properties`里的默认值`arthas.telnetPort=3658`。 +* 如果应用自身设置了 system properties `arthas.telnetPort=8888`,则会覆盖掉`arthas.properties`里的默认值`arthas.telnetPort=3658`。 + +如果想要 `arthas.properties`的优先级最高,则可以配置 `arthas.config.overrideAll=true` 。 + diff --git a/site/src/site/sphinx/en/advanced-use.md b/site/src/site/sphinx/en/advanced-use.md index 46794e852..29233e555 100644 --- a/site/src/site/sphinx/en/advanced-use.md +++ b/site/src/site/sphinx/en/advanced-use.md @@ -86,6 +86,10 @@ Arthas supports living inside a browser. The communication between arthas and br * [Web Console](web-console.md) +## Arthas Properties + +* [Arthas Properties](arthas-properties.md) + ## Start as a Java Agent * [Start as a Java Agent](agent.md) diff --git a/site/src/site/sphinx/en/agent.md b/site/src/site/sphinx/en/agent.md index 1c0ee1a0e..005508fbf 100644 --- a/site/src/site/sphinx/en/agent.md +++ b/site/src/site/sphinx/en/agent.md @@ -9,6 +9,6 @@ For example, download the full arthas zip package, decompress it and start it by java -javaagent:/tmp/test/arthas-agent.jar -jar arthas-demo.jar ```` -The default configuration is in the `arthas.properties` file in the decompression directory. +The default configuration is in the `arthas.properties` file in the decompression directory. Reference: [Arthas Properties](arthas-properties.md) Reference: https://docs.oracle.com/javase/8/docs/api/java/lang/instrument/package-summary.html \ No newline at end of file diff --git a/site/src/site/sphinx/en/arthas-properties.md b/site/src/site/sphinx/en/arthas-properties.md new file mode 100644 index 000000000..312764242 --- /dev/null +++ b/site/src/site/sphinx/en/arthas-properties.md @@ -0,0 +1,38 @@ +Arthas Properties +=== + +The `arthas.properties` file is in the arthas directory. + +* If it is automatically downloaded arthas, the directory is under `~/.arthas/lib/3.x.x/arthas/` +* If it is a downloaded complete package, under the decompression directory of arthas + +## Supported configuration items + +``` +#arthas.config.overrideAll=true +arthas.telnetPort=3658 +arthas.httpPort=8563 +arthas.ip=localhost + +#arthas.tunnelServer=ws://127.0.0.1:7777/ws +#arthas.agentId=mmmmmmyiddddd +``` + + +* If the configuration of `arthas.telnetPort` is -1, the telnet port will not be listened. `arthas.httpPort` is similar. +* If you configure `arthas.telnetPort` to 0, then random listen telnet port, you can find the random port log in `~/logs/arthas/arthas.log`. `arthas.httpPort` is similar. + +> If you want to prevent multiple arthas port conflicts on a machine. It can be configured as a random port, or configured as -1, and use arthas through the tunnel server. + +## Configured order + +The order of configuration is: command line parameters > System Env > System Properties > arthas.properties. + +such as: + +* `./as.sh --telnet-port 9999` command line configuration will overwrite the default value `arthas.telnetPort=3658` in `arthas.properties`. +* If the application itself sets system properties `arthas.telnetPort=8888`, it will override the default value `arthas.telnetPort=3658` in `arthas.properties`. + +If you want `arthas.properties` to have the highest order, you can configure `arthas.config.overrideAll=true`. + + diff --git a/site/src/site/sphinx/en/spring-boot-starter.md b/site/src/site/sphinx/en/spring-boot-starter.md index e08926f70..49ac6a552 100644 --- a/site/src/site/sphinx/en/spring-boot-starter.md +++ b/site/src/site/sphinx/en/spring-boot-starter.md @@ -29,6 +29,7 @@ arthas.tunnel-server=ws://47.75.156.201:7777/ws All supported configuration: [Reference](https://github.com/alibaba/arthas/blob/master/arthas-spring-boot-starter/src/main/java/com/alibaba/arthas/spring/ArthasProperties.java) +Reference: [Arthas Properties](arthas-properties.md) ### View Endpoint Information diff --git a/site/src/site/sphinx/spring-boot-starter.md b/site/src/site/sphinx/spring-boot-starter.md index 0b5d8cd95..1f7cc098b 100644 --- a/site/src/site/sphinx/spring-boot-starter.md +++ b/site/src/site/sphinx/spring-boot-starter.md @@ -29,6 +29,7 @@ arthas.tunnel-server=ws://47.75.156.201:7777/ws 全部支持的配置项:[参考](https://github.com/alibaba/arthas/blob/master/arthas-spring-boot-starter/src/main/java/com/alibaba/arthas/spring/ArthasProperties.java) +参考:[Arthas Properties](arthas-properties.md) ### 查看Endpoint信息