site/docs/doc/arthas-properties.md
arthas.properties文件在 arthas 的目录下。
~/.arthas/lib/3.x.x/arthas/下面::: warning
注意配置必须是驼峰的,和 spring boot 的-风格不一样。spring boot 应用才同时支持驼峰 和 -风格的配置。
:::
#arthas.config.overrideAll=true
arthas.telnetPort=3658
arthas.httpPort=8563
arthas.ip=127.0.0.1
# seconds
arthas.sessionTimeout=1800
#arthas.appName=demoapp
#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类似。:::tip 如果是防止一个机器上启动多个 arthas 端口冲突。可以配置为随机端口,或者配置为 -1,并且通过 tunnel server 来使用 arthas。 :::
::: tip since 3.5.2 :::
比如配置:
arthas.disabledCommands=stop,dump
也可以在命令行配置: --disabled-commands stop,dump 。
::: tip
默认情况下,arthas-spring-boot-starter 会禁掉stop命令。
:::
配置的优先级是:命令行参数 > System Env > System Properties > arthas.properties 。
比如:
./as.sh --telnet-port 9999 传入的配置会覆盖掉arthas.properties里的默认值arthas.telnetPort=3658。arthas.telnetPort=8888,则会覆盖掉arthas.properties里的默认值arthas.telnetPort=3658。如果想要 arthas.properties的优先级最高,则可以配置 arthas.config.overrideAll=true 。