Skip to content

Commit

Permalink
update faq.md
Browse files Browse the repository at this point in the history
  • Loading branch information
hengyunabc committed Jan 25, 2024
1 parent 57d8b62 commit 2f5ab94
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
22 changes: 22 additions & 0 deletions site/docs/doc/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,28 @@

日志文件路径: `~/logs/arthas/arthas.log`


### telnet: connect to address 127.0.0.1: Connection refused

1. 检查日志 `~/logs/arthas/arthas.log`
2. 检查`as.sh`/`arthas-boot.jar` 的启动参数,是否指定了特定的`port`
3.`netstat` 检查`LISTEN 3658` 端口的进程,确认它是`java`进程,并且是想要诊断的进程
4. 如果`LISTEN 3658` 端口的进程不是 `java` 进程,则`3658`端口已经被占用。需要在`as.sh`/`arthas-boot.jar` 的启动参数指定其它端口。
5. 确认进程和端口后,尝试用`telnet 127.0.0.1 3658`去连接


本质上`arthas`会在应用java进程内启动一个`tcp server`,然后使用`telnet`去连接它。

1. 可能端口不匹配
2. 可能进程本身已经挂起,不能接受新连接


如果Arthas 日志里有 `Arthas server already bind.`

1. 说明`Arthas server`曾经启动过,检查目标进程打开的文件描述符。如果是`linux`环境,可以去 `/proc/$pid/fd` 下面,使用`ls -alh | grep arthas`,检查进程是否已加载`arthas`相关的 jar 包。
2. 如果没有,那么可能已启动`arthas`的是其它进程,也可能应用已经重启过了。


### Arthas attach 之后对原进程性能有多大的影响

[https://github.com/alibaba/arthas/issues/44](https://github.com/alibaba/arthas/issues/44)
Expand Down
19 changes: 19 additions & 0 deletions site/docs/en/doc/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,25 @@ For questions that are not in this list, please search in issues. [https://githu

Log file path: `~/logs/arthas/arthas.log`


### telnet: connect to address 127.0.0.1: Connection refused

1. Check the log `~/logs/arthas/arthas.log`
2. Check the startup parameters of `as.sh`/`arthas-boot.jar`, whether a specific `port` is specified
3. Use `netstat` to check the process of `LISTEN 3658` port, confirm it is a `java` process, and it is the process you want to diagnose
4. If the process of `LISTEN 3658` port is not a `java` process, then the `3658` port is already occupied. You need to specify other ports in the startup parameters of `as.sh`/`arthas-boot.jar`.
5. After confirming the process and port, try to connect with `telnet 127.0.0.1 3658`

Essentially, `arthas` will start a `tcp server` within the application java process, and then use `telnet` to connect to it.

1. The port may not match
2. The process itself may have been suspended and cannot accept new connections

If there is `Arthas server already bind.` in the Arthas log

1. It means that the `Arthas server` has been started before, check the file descriptors opened by the target process. If it is a `linux` environment, you can go to `/proc/$pid/fd`, use `ls -alh | grep arthas` to check whether the process has loaded the `arthas` related jar package.
2. If not, it may be that other processes have started `arthas`, or the application has been restarted.

### How much impact does Arthas attach have on the performance of the original process?

[https://github.com/alibaba/arthas/issues/44](https://github.com/alibaba/arthas/issues/44)
Expand Down

0 comments on commit 2f5ab94

Please sign in to comment.