We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
arthas-boot.jar
as.sh
arthas-boot
The text was updated successfully, but these errors were encountered:
以前我遇到过类似需求,当时写了一份脚本。
#!/bin/bash # 获取当前脚本所在的目录 script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) # 用户输入进程ID read -p "请输入进程ID: " pid # 用户输入可选参数host,提供默认值 read -p "请输入主机地址和端口号(格式:IP 端口,默认为 127.0.0.1 3658): " host host=${host:-"127.0.0.1 3658"} # 检查当前目录下是否存在jattach文件 if [[ ! -e "$script_dir/jattach" ]]; then # 查找以jattach-linux开头的tgz压缩包 jattach_tgz=$(find "$script_dir" -maxdepth 1 -type f -name "jattach-linux-*.tgz") if [[ -z "$jattach_tgz" ]]; then echo "当前目录下未找到名为jattach的文件或符合条件的jattach-linux-*.tgz压缩包。" exit 1 fi # 判断系统架构 system_arch=$(uname -m) case $system_arch in "aarch64"|"arm64") arch="arm64" jattach_file="jattach-linux-arm64.tgz" ;; "x86_64"|"amd64") arch="x64" jattach_file="jattach-linux-x64.tgz" ;; *) echo "当前系统架构不支持自动解压jattach工具。" exit 1 esac # 检查对应的jattach压缩包是否存在 if [[ ! -f "$script_dir/$jattach_file" ]]; then echo "当前目录下未找到与系统架构匹配的$jattach_file压缩包。" exit 1 fi # 解压缩对应架构的jattach工具到当前脚本目录,并使用绝对路径 tar -xzvf "$script_dir/$jattach_file" -C "$script_dir" # 检查解压后jattach是否成功生成 if [[ ! -e "$script_dir/jattach" ]]; then echo "解压失败或未能在当前目录找到解压后的jattach文件。" exit 1 fi fi # 使用jattach命令加载arthas-agent.jar,使用绝对路径 "$script_dir/jattach" $pid load instrument false "$script_dir/arthas-agent.jar" && \ # 运行arthas客户端,同样使用绝对路径 java -jar "$script_dir/arthas-client.jar" $host
使用方式是把jattach的安装包和这份脚本一起放在arthas的安装目录下,会自动执行安装和attach的操作。路径很重要,不要错。
之前在很多环境验证过,都能正常使用。
我看脚本中的attach逻辑和你提供的命令似乎不太一样,但是我后来也没深究,所以不能回答你的问题。
而且你遇到的问题看上去也并不是Arthas的问题。
另外,这份脚本并没有在docker中验证过,大概率是不可用的😂。
Sorry, something went wrong.
No branches or pull requests
环境信息
arthas-boot.jar
或者as.sh
的版本: 4.0.3arthas-boot
的版本: 4.0.3重现问题的步骤
Connected to remote JVM
JVM response code = 0
0
且成功监听3658和8563端口, 再次通过java -jar $PWD/arthas-client.jar 可以成功连接进入console使用
Connected to remote JVM
JVM response code = 0
100
3658和8563端口未监听, 再次通过java -jar $PWD/arthas-client.jar 可以连接失败. 未找到任何arthas日志
期望的结果
实际运行的结果
The text was updated successfully, but these errors were encountered: