Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jps process unavailable as root user

Tags:

java

hadoop

I have successfully installed Hadoop CDH5.2 on CentOS with JDK 1.7.0_80.

Processes start and are running successfully. However when I try to display the list of java processes as root using jps, it only returns the IDs and no description:

[root@elephant ~]# jps
11478 Jps
2871 -- process information unavailable
2972 -- process information unavailable
3146 -- process information unavailable
3611 -- process information unavailable
2796 -- process information unavailable
3445 -- process information unavailable

If I sudo as hdfs, I can see its processes description:

[root@elephant ~]# sudo -u hdfs jps
2871 SecondaryNameNode
11495 Jps
2972 DataNode
2796 NameNode

What could be causing root not to retrieve the process descriptions?

like image 472
Regis Cabaret Avatar asked Jul 22 '15 03:07

Regis Cabaret


1 Answers

All these pid's are stored in /tmp directory. Processes started by individual users will be stored in a directory /tmp/hsperfdata_{username}. Seems like root user is unable to read that file. Stop all the processes, Clear the /tmp directory and start all the processes again.After this, try the jps command again.

Update:

If you are using openjdk, you will face this issue. For viewing all the hdfs related process, you have to use the command below

sudo -u hdfs jps

Similarly for yarn processes, you have to use the below command

sudo -u yarn jps

If you use oracle jdk, jps command from the root user will list all the processes, provided that JAVA_HOME is defined properly and $JAVA_HOME/bin is in your PATH.

like image 101
Amal G Jose Avatar answered Oct 10 '22 21:10

Amal G Jose