From 2f5ab940324b6eb47bcaa1f6859a93ddaf85e1e0 Mon Sep 17 00:00:00 2001 From: hengyunabc Date: Thu, 25 Jan 2024 17:15:15 +0800 Subject: [PATCH] update faq.md --- site/docs/doc/faq.md | 22 ++++++++++++++++++++++ site/docs/en/doc/faq.md | 19 +++++++++++++++++++ 2 files changed, 41 insertions(+) diff --git a/site/docs/doc/faq.md b/site/docs/doc/faq.md index fb6477e2e5..c2052f345b 100644 --- a/site/docs/doc/faq.md +++ b/site/docs/doc/faq.md @@ -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) diff --git a/site/docs/en/doc/faq.md b/site/docs/en/doc/faq.md index c8e03b9605..0d0f51ba6c 100644 --- a/site/docs/en/doc/faq.md +++ b/site/docs/en/doc/faq.md @@ -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)