hadoop启动报错:Attempting to operate on hdfs namenode as root

hadoop启动报错:Attempting to operate on hdfs namenode as root_第1张图片
在hadoop安装路径的 /hadoop/sbin路径下:
start-dfs.sh,stop-dfs.sh两个文件顶部添加以下参数

#!/usr/bin/env bash
HDFS_DATANODE_USER=root
HADOOP_SECURE_DN_USER=hdfs
HDFS_NAMENODE_USER=root
HDFS_SECONDARYNAMENODE_USER=root

还有,start-yarn.sh,stop-yarn.sh顶部也需添加以下:

#!/usr/bin/env bash
YARN_RESOURCEMANAGER_USER=root
HADOOP_SECURE_DN_USER=yarn
YARN_NODEMANAGER_USER=root

修改后重启 ./start-dfs.sh,成功!

你可能感兴趣的:(大数据,Hadoop,hadoop,hdfs,大数据)