Remote Profiling with sudo

Questions about YourKit Java Profiler
Post Reply
miwoe
Posts: 2
Joined: Sat Aug 05, 2017 10:17 am

Remote Profiling with sudo

Post by miwoe »

Hi,

my primary aim is to use a profile for production environments to allow to connect to the withouth doing some additional configuration.

I have seen that the Java Profiler supports ssh. My problem is that our applications are running with an user which can not connect via ssh which is a typically setup, I think.

I have seen that the competitor JProfile support su(do) command, so that you can set up ssh for one account which has su(do) rights to switch to the user which is running the JVMs.

Is that also possible with Java Profile? If not, it is a planned feature?

Best Regards,
Michael
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Re: Remote Profiling with sudo

Post by Anton Katilin »

Hello Michael

I'm not sure I understand particularly which feature you mean. Could you please share a link.

Anyway, it is not required to the user under which you run the profiled JVM process to be able to do anything with SSH.

Instead, all you need is to have a user on the remote machine under which you can connect to that machine from your local machine running the profiler UI via SSH. If you do, you should be able to profile any profiling enabled application on that machine.

Please follow these instructions:
https://www.yourkit.com/docs/java/help/ ... filing.jsp

Best regards,
Anton
miwoe
Posts: 2
Joined: Sat Aug 05, 2017 10:17 am

Re: Remote Profiling with sudo

Post by miwoe »

Hi, Anton,

I mean this:
https://www.ej-technologies.com/product ... new10.html
Picture 3

There you can add sudo rights.
Normally, we cannot login directly with the user running the JVM.

However, for test case, I have added /bin/bash for the user in one environment, but still Java Profile is not finding any JVM, although running jps, I get this output:

:/$ jps
1676 Jps
25087 movies.jar

Have seen that I have do attach an agent on the JVM. As it is possible to attach it while running, why is JProfiler not doing it via the ssh account on demand? For doing it, do I have to install JProfile on each individual machine which I want to profile (on demand)?
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Re: Remote Profiling with sudo

Post by Anton Katilin »

Please read the topic I suggested in my previous post:
https://www.yourkit.com/docs/java/help/ ... filing.jsp

You should enable profiling by either configuring the JVM to run with the agent:
https://www.yourkit.com/docs/java/help/ ... remote.jsp

... or attach the agent to a running JVM:
https://www.yourkit.com/docs/java/help/ ... wizard.jsp
Post Reply