Hadoop3 启动,提示ERROR: Attempting to operate on hdfs namenode as root ***
Posted 在奋斗的大道
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Hadoop3 启动,提示ERROR: Attempting to operate on hdfs namenode as root ***相关的知识,希望对你有一定的参考价值。
在CentOS-7 搭建伪分布式Hadoop3 测试环境,执行start-all.sh 提示如下错误信息:
Starting namenodes on [namenode]
ERROR: Attempting to operate on hdfs namenode as root
ERROR: but there is no HDFS_NAMENODE_USER defined. Aborting operation.
Starting datanodes
ERROR: Attempting to operate on hdfs datanode as root
ERROR: but there is no HDFS_DATANODE_USER defined. Aborting operation.
Starting secondary namenodes [datanode1]
ERROR: Attempting to operate on hdfs secondarynamenode as root
ERROR: but there is no HDFS_SECONDARYNAMENODE_USER defined. Aborting operation.
Starting resourcemanager
ERROR: Attempting to operate on yarn resourcemanager as root
ERROR: but there is no YARN_RESOURCEMANAGER_USER defined. Aborting operation.
Starting nodemanagers
ERROR: Attempting to operate on yarn nodemanager as root
ERROR: but there is no YARN_NODEMANAGER_USER defined. Aborting operation.
造成此问题的原因是:将Hadoop各进程(NameNode、DataNode、SECONDARYNAMENODE、ResourceManager、NodeManager)用户设置为root,而start-dfs.sh/stop-dfs.sh、start-yarn.sh/stop-yarn.sh 脚本没有添加root 账户声明。
解决办法:
在start-dfs.sh/stop-dfs.sh 开头处添加如下代码片段:
HDFS_DATANODE_USER=root
HADOOP_SECURE_DN_USER=hdfs
HDFS_NAMENODE_USER=root
HDFS_SECONDARYNAMENODE_USER=root
在start-yarn.sh/stop-yarn.sh 开头处添加如下代码片段:
YARN_RESOURCEMANAGER_USER=root
HADOOP_SECURE_DN_USER=yarn
YARN_NODEMANAGER_USER=root
以上是关于Hadoop3 启动,提示ERROR: Attempting to operate on hdfs namenode as root ***的主要内容,如果未能解决你的问题,请参考以下文章
如何从 raise_application_error() 获取信息?
xampp 启动apache 提示:Error: Apache shutdown unexpectedly.