Jstack alternatives for JVM with "kill -3" command

If you are not able to for some reason switch user as hbase to collect Jstack,  you can run the following to collect the similiar information with kill -3 command.

This won't kill the process, but it just dumps the stack threads in to .out file.

echo > /var/log/hbase/hbase-hbase-regionserver-hbase4.openstacklocal.out
kill -3 `cat /var/run/hbase/hbase-hbase-regionserver.pid`
cp /var/log/hbase/hbase-hbase-regionserver-hbase4.openstacklocal.out   "Jstack_$(date +"%Y_%m_%d_%I_%M_%p")_`hostname`.log"

No comments:

Post a Comment

Boost Your Download Speed with lftp Segmentation

Looking for a faster way to download files via sftp to a Linux machine? Try using "lftp" instead. This tool offers segmented downl...

Other relevant topics