启动arthas之后, 选择要attach的进程之后控制台报错内容如下:

[INFO] arthas home: /root/.arthas/lib/3.5.0/arthas
[ERROR] The telnet port 3658 is used by process 27820 instead of target process 24012, you will connect to an unexpected process.
[ERROR] 1. Try to restart arthas-boot, select process 27820, shutdown it first with running the 'stop' command.
[ERROR] 2. Or try to stop the existing arthas instance: java -jar arthas-client.jar 127.0.0.1 3658 -c "stop"
[ERROR] 3. Or try to use different telnet port, for example: java -jar arthas-boot.jar --telnet-port 9998 --http-port -1
[root@sian-application-dev tools]# java -jar arthas-boot.jar

这个一般出现在远程到服务器上之后,没有正常退出arthas监听进程,然后远程ssh过期了,需要重新登录服务器。然后再次attach与上一次不同的进程之后就会出现这个错误。

解决办法:
根据错误提示找到对应的进程, 如上面日志提示进程是27820, 则启动arthas之后,重新选择这个进程attach,成功之后执行stop命令,然后再正常退出arthas即可,再次启动attach其它进程即可。

更多推荐

arthas The telnet port 3658 is used by process