Using jps and jstat with jboss
willemnoorduin Jan 14, 2013 1:43 AMWe are trying to set up some basic monitoring with jps and jstat and we are running into a problem. For usage of these tools there is a hsperfdata_${user} directory created by the jvm, by default in /tmp. Only in our case, it is not created. Hence we cannot use jps, jstat or the other jvm tools. Some information:
root@nlptc27b09:/tmp# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 6.3 (Santiago)
root@nlptc27b09:/tmp# uname -a
Linux nlptc27b09 2.6.32-279.11.1.el6.x86_64 #1 SMP Sat Sep 22 07:10:26 EDT 2012 x86_64 x86_64 x86_64 GNU/Linux
root@nlptc27b09:/tmp# /distr/jdk/bin/java -version
java version "1.6.0_27"
Java(TM) SE Runtime Environment (build 1.6.0_27-b07)
Java HotSpot(TM) Server VM (build 20.2-b06, mixed mode)
root@nlptc27b09:/tmp# ls -ls /tmp
total 16
0 drwxr-xr-x. 2 root root 40 Jan 14 07:21 hsperfdata_root
12 -rwxr-xr-x. 1 root root 8630 Dec 13 15:30 iptables
4 -rwxr-xr-x. 1 root root 324 Dec 13 12:53 iptables-ctl.sh
0 drwxr-xr-x. 2 wnoordui users 40 Dec 12 10:20 iptables.d
0 drwx------. 2 root root 40 Dec 18 11:46 mc-root
0 drwx------. 2 wnoordui wnoordui 40 Dec 3 09:44 mc-wnoordui
0 drwx------. 2 root root 40 Nov 14 10:53 vmware-root
root@nlptc27b09:/tmp# ls -ld /tmp
drwxrwxrwt. 8 root root 200 Jan 14 07:18 /tmp
We are running jboss under a non-root user (as it should) named jboss. We have tried the next things, with different results:
- Running jboss under root. => Then the directory hsperdata_root is used and we get results (but you don't want that).
- Putting -XX:+UsePerfData -Djava.io.tmpdir=/tmp as Java options => has no results (there is no hsperdata_jboss, in our case, created).
- Switching to the last stable release of SUN/Oracle SDK => has no results (there is no hsperdata_jboss, in our case, created).
- Switching to OpenJDK on Redhat => Now we get a /tmp/hsperfdata_jboss (but we don't want to use OpenJDK for our production JBoss).
- Switching to another OS (Debian 6.0.6) and the same SUN JDK => Is working fine.
- Putting -XX:+UsePerfData -Djava.io.tmpdir=/home/jboss/tmp (where this last directory is writeable by user jboss) as Java options => has no results (there is no hsperdata_jboss, in our case, created).
I am communicating with Redhat on this, since the swritch from SUN to OpenJDK or/and Redhat to another Linux OS seemed to do the trick, but all I learned was that it might be a permission issue. But:
root@nlptc27b09:/apps/jboss/test/configs# su - jboss
jboss@nlptc27b09:~$ cd /tmp
jboss@nlptc27b09:/tmp$ mkdir i-am-a-directory
jboss@nlptc27b09:/tmp$ touch i-am-a-directory/i-am-a-file
jboss@nlptc27b09:/tmp$ ls -lR i-am-a-directory/
i-am-a-directory/:
total 0
-rw-rw-r--. 1 jboss jboss 0 Jan 14 07:38 i-am-a-file
on Redhat says otherwise. Also, you can google all you want on this problem, all I found was ways to turn the perfstats off, not on. Can someone tell me where I went wrong ? Also, the residental Linux Gurus on our team seems to point that this is really a java issue.