Debug JVM on kubernetes using jstatd

6/10/2019

I want to dedbug the jvm running in a pod using visualvm. I have to setup and running jstatd on the pod:

>jstatd -p 8999 -J-Djava.security.policy=jstatd.all.policy -J-Djava.rmi.server.hostname=10.36.0.15 -J-Djava.rmi.server.logCalls=true -J- &
>Jun 10, 2019 7:14:50 PM sun.rmi.server.UnicastServerRef logCall
FINER: RMI TCP Connection(4)-10.36.0.15: [10.36.0.15: sun.rmi.registry.RegistryImpl[0:0:0, 0]: void rebind(java.lang.String, java.rmi.Remote)]
Jun 10, 2019 7:14:50 PM sun.rmi.server.UnicastServerRef logCall
FINER: RMI TCP Connection(1)-10.36.0.15: [10.36.0.15: sun.rmi.transport.DGCImpl[0:0:0, 2]: java.rmi.dgc.Lease dirty(java.rmi.server.ObjID[], long, java.rmi.dgc.Lease)]

I then expose the port 8999 using a service and then using kubetcl port-forwardto forward the port to my machine.

However when I add the jstatd connection myip:8999 in visualvm it doesn't come up with any vm connection. Is there something i'm missing?

-- Sam Palmer
java
jstatd
kubernetes
linux

0 Answers