赞
踩
在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
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。