Cannot connect JVM which running on AWS EC2

Questions about YourKit Java Profiler
Post Reply
muthu
Posts: 2
Joined: Thu Apr 05, 2018 10:15 am

Cannot connect JVM which running on AWS EC2

Post by muthu »

Hi YourKit experts,

Recently I want to utilize YourKit to remotely monitor Tomcat which is running on an AWS EC2 server. But when run the following command i got the following result. How to overcome this issue. I have googled and not found the related answer

Name | PID| Status
-------------------------------- |------|--------------------------------
Tomcat | 22378| Ready for attach

Enter PID of the application you want to attach (0 to exit) and press Enter:
>22378
Please specify comma-separated list of startup options, or press Enter for default options (recommended):
>
Attaching to process 22378 using options
com.yourkit.util.bf: com.sun.tools.attach.AttachNotSupportedException: Unable to open socket file: target process not responding or HotSpot VM not loaded
at com.yourkit.b.f.a(a:97)
at com.yourkit.b.c.attach(a:181)
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.yourkit.h.run(a:2)

Attach to a running JVM failed.

With Regards,
-Muthu
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Re: Cannot connect JVM which running on AWS EC2

Post by Anton Katilin »

Hi Muthu

Please try the Early Access version:
https://www.yourkit.com/eap/

It allows remote attach directly from the profiler UI's Welcome screen.

If it neither works, could you please send the profiler log files from ~/.yjp/log to [email protected]

Please also note that if attaching the profiler agent to a running process doesn't work, you may start it with the profiler agent instead.

Best regards,
Anton
muthu
Posts: 2
Joined: Thu Apr 05, 2018 10:15 am

Re: Cannot connect JVM which running on AWS EC2

Post by muthu »

Hi Anton,

As per your response i just used the YourKit-JavaProfiler-2018.04-b48 and tried to attach the tomcat. But it is not working. Hence i have started the profiler agent instead attach to running process also it requires tomcat startup script and my bad luck, we do not have that. We use only startup service. Any other solutions..

Best regards,
Muthu
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Re: Cannot connect JVM which running on AWS EC2

Post by Anton Katilin »

Hello Muthu,

Could you please send us the logs, as I suggested in my previous post. Without the logs it is difficult to investigate why attach fails in your case.

To start Tomcat with the profiler agent, you should specify appropriate Java option -agentpath. Please use the remote wizard's option "Generic server" to produce it; see https://www.yourkit.com/docs/java/help/ ... remote.jsp

Best regards,
Anton
Post Reply