Skip to content
New issue

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

开发一个native agent和远程管理平台,方便管理集群 #2163

Open
hengyunabc opened this issue Apr 26, 2022 · 4 comments
Open

开发一个native agent和远程管理平台,方便管理集群 #2163

hengyunabc opened this issue Apr 26, 2022 · 4 comments
Labels
help wanted Extra attention is needed

Comments

@hengyunabc
Copy link
Collaborator

hengyunabc commented Apr 26, 2022

目前,Arthas只支持用 arthas-spring-boot-starter的方式,让应用引入arthas,然后在启动时attach自身,再连接到 tunnel server上。

这种方式有很多缺陷:

  • 应用启动时就需要attach自身,不能做到动态attach
  • 应用如果自身没有响应了,在tunnel server上也没办法查看了

因此,考虑一种真正支持大规模管控的方式。

  • 在应用机器上,启动一个常驻的native agent
  • native agent可以考虑用rust/java GraalVM/go 等(java GraalVM有mavend可以参考 https://github.com/apache/maven-mvnd)
  • native agent负责连接远程管理平台,接收管理平台的 attach 命令,负责中转arthas的执行命令和结果
  • native agent要充分考虑安全问题,比如要支持TLS连接
  • 考虑docker/k8s环境下支持,比如 native agent本身以sidecar方式,或者k8s临时容器方式部署,参考:在k8s 临时容器 ephemeral container里 attach 问题 #1874

整个事情比较多,考虑一步步实现。

agent的基本功能

  • Agent侧支持查看,列出所有java 进程
  • 支持通过jvm自身机制去attach
  • 支持sidecar方式,或者k8s临时容器的attach (考虑集成 https://github.com/apangin/jattach

agent和server端交互

  • 启动时注册到server报,上报信息
  • 接收server端的attach指令
  • 接收server端的诊断命令,返回结果到server端

server端的管理UI

  • 查看agent列表
  • agent管理功能

参考: #1350

@hengyunabc hengyunabc added the help wanted Extra attention is needed label Apr 26, 2022
@1994
Copy link
Contributor

1994 commented Apr 28, 2022

这种场景rust感觉更适合一点,既有安全性,又有native能力

@zhangjin-007
Copy link
Contributor

用go是不是平台性上更有优势

@tullyliu
Copy link

用graalvm编译的改造成本比较低,主程序native化,可以使用VirtualMachine.attach的功能,把javaagent注入到其他java进程。这样可以不依赖jdk也能启动Arthas

@zijiwork
Copy link

用go重写了支持在k8s诊断 https://github.com/dnsjia/luban

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

5 participants