Giter Site home page Giter Site logo

Comments (7)

aylei avatar aylei commented on May 10, 2024

Could you please provide the detailed commands executed?

from kubectl-debug.

ly-wjj avatar ly-wjj commented on May 10, 2024

如果使用arthas镜像调式java程序呢?
执行过程如下:
kubectl debug -n java-demo --image hengyunabc/arthas:latest /bin/sh
然后进入容器后,执行命令
cd /opt/arthas
java -jar arthas-boot.jar 9
返回结果
INFO] arthas-boot version: 3.2.0
[INFO] arthas home: /opt/arthas
[INFO] Try to attach process 9
[ERROR] Start arthas failed, exception stack trace:
com.sun.tools.attach.AttachNotSupportedException: Unable to open socket file: target process not responding or HotSpot VM not loaded
at sun.tools.attach.LinuxVirtualMachine.(LinuxVirtualMachine.java:106)
at sun.tools.attach.LinuxAttachProvider.attachVirtualMachine(LinuxAttachProvider.java:63)
at com.sun.tools.attach.VirtualMachine.attach(VirtualMachine.java:208)
at com.taobao.arthas.core.Arthas.attachAgent(Arthas.java:83)
at com.taobao.arthas.core.Arthas.(Arthas.java:28)
at com.taobao.arthas.core.Arthas.main(Arthas.java:123)
[INFO] Attach process 9 success.
[INFO] arthas-client connect 127.0.0.1 3658
Connect to telnet server error: 127.0.0.1 3658
java.net.ConnectException: Connection refused (Connection refused)
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:589)
at org.apache.commons.net.SocketClient.connect(SocketClient.java:188)
at org.apache.commons.net.SocketClient.connect(SocketClient.java:209)
at com.taobao.arthas.client.TelnetConsole.main(TelnetConsole.java:249)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.taobao.arthas.boot.Bootstrap.main(Bootstrap.java:547)
Usage: arthas-client [-h ] [--help] [-c ] [-f ] [-w
] [target-ip] [port]

from kubectl-debug.

ArthurYangZhiBin avatar ArthurYangZhiBin commented on May 10, 2024

from kubectl-debug.

ly-wjj avatar ly-wjj commented on May 10, 2024

先将arthas的jar包放到对应的文件系统中,然后chroot到对应的文件系统中,进行调试

from kubectl-debug.

aylei avatar aylei commented on May 10, 2024

Also, v0.1.1 lacks the SYS_PTRACE and SYS_ADMIN capabilities, could you please try out v0.2.0-rc?

from kubectl-debug.

morningyi avatar morningyi commented on May 10, 2024

试了v0.2.0-rc版本还是同样的报错,最后解决方法如下:
chroot /proc/1/root
sudo -u [USER] jstack [PID]

其中:
[PID] Java进程号
[USER] 执行Java进程的用户,可以通过ps来查看

from kubectl-debug.

laitianliu avatar laitianliu commented on May 10, 2024

所以现在可以通过kubectl debug调试集群java应用嘛。。 @ @ArthurYangZhiBin

我测试过用openjdk的java启动无法读取pid 为1的进程。采用oracle jdk有效。

from kubectl-debug.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.