本文主要是介绍hadoop 安装FAQ ERROR: Attempting to operate on hdfs namenode as root,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
问题
[root@localhost hadoop]# start-dfs.sh
Starting namenodes on [node21]
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 [node21]
ERROR: Attempting to operate on hdfs secondarynamenode as root
ERROR: but there is no HDFS_SECONDARYNAMENODE_USER defined. Aborting operation.
原因
缺少用户定义造成的
解决
在hadoop环境变量中指定用户
# 修改hadoop环境变量文件
vi $HADOOP_HOME/etc/hadoop/hadoop-env.sh
#jdk
#export JAVA_HOME=/usr/local/java/jdk1.8.0_251
#追加
export HDFS_NAMENODE_USER=root
export HDFS_DATANODE_USER=root
export HDFS_SECONDARYNAMENODE_USER=root#高可用分布式还会用到的用户
export HDFS_JOURNALNODE_USER=root
export HDFS_ZKFC_USER=root
修改后重启 ./start-dfs.sh
这篇关于hadoop 安装FAQ ERROR: Attempting to operate on hdfs namenode as root的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!