jps命令详解

作者: 吃货大米饭 | 来源:发表于2019-07-04 11:18 被阅读0次

    1.jps命令位置

    [hadoop@Hadoop001 tmp]$ which jps
    /usr/java/jdk1.8.0_45/bin/jps
    [hadoop@Hadoop001 tmp]$ which java
    /usr/java/jdk1.8.0_45/bin/java
    

    2.查看java进程

    [hadoop@Hadoop001 tmp]$ jps
    4882 NameNode
    4982 DataNode
    5177 SecondaryNameNode
    5371 Jps
    

    3.存储进程pid (hsperfdata_用户名称)

    [hadoop@Hadoop001 tmp]$ ll
    drwxr-xr-x  2 hadoop hadoop 4096 Jul  4 04:33 hsperfdata_hadoop
    [hadoop@Hadoop001 tmp]$ cd hsperfdata_hadoop/
    [hadoop@Hadoop001 hsperfdata_hadoop]$ ll
    total 96
    -rw------- 1 hadoop hadoop 32768 Jul  4 04:33 4882
    -rw------- 1 hadoop hadoop 32768 Jul  4 04:33 4982
    -rw------- 1 hadoop hadoop 32768 Jul  4 04:33 5177
    

    4.process information unavailable

    [root@Hadoop001 dfs]# jps
    4882 -- process information unavailable
    5397 Jps
    4982 -- process information unavailable
    5177 -- process information unavailable
    [alvin@Hadoop001 ~]$ jps
    5452 Jps
    

    进程所在的用户jps查看显示进程信息,
    非root用户没有,
    root显示process information unavailable。如果进程被kill了,有可能jps 还是显示xxxx -- process information unavailable,需要用ps -ef | grep pid 确认。

    相关文章

      网友评论

        本文标题:jps命令详解

        本文链接:https://www.haomeiwen.com/subject/vkdlhctx.html