为什么 JPS 没有显示进程 运行?

Why is JPS showing no process running?

我是 运行 一个使用 apache-hadoop 二进制文件的 hadoop,我已经使用以下命令启动了 dfs、yarn 和 mr deamon:

start-dfs.sh
start-yarn.sh
mr-jobhistory-daemon.sh start historyserver

在此之后一切正常,即,我可以看到 HDFS UI、资源管理器 UI、作业历史记录 UI 等

这是 jps 命令的输出:

sh-3.2# jps
61601 Jps
sh-3.2#

但是,当我使用 jps 命令检查哪些进程是 运行 时,它显示没有进程 运行、没有名称节点、没有数据节点、没有资源管理器、没有辅助名称节点。尽管如此,我可以轻松地将文件从本地复制到 HDFS,在 HDFS 上创建目录等

我的问题是为什么 jps 命令没有显示实际上是 运行 的进程?我们是否需要使用其他参数调用 jps 来检查进程?

引自 jps 文档:

The list of JVMs produced by the jps command can be limited by the permissions granted to the principal running the command. The command only lists the JVMs for which the principle has access rights as determined by operating system-specific access control mechanisms.

实际上,这通常意味着 jps 仅打印同一用户 运行ning jps 拥有的 JVM 进程的信息。在典型的 Hadoop 集群中,守护进程 运行 在不同的用户下,例如NameNode 的用户 hdfs 和 ResourceManager 的用户 yarn。如果您作为这些用户之一具有 sudo 访问权限并且 运行 jps,那么您可以看到进程。