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/_sources/arthas-properties.md.txt

41 lines
1.3 KiB
Plaintext

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.

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` 。