关于Hadoop全分布构建no HDFS_NAMENODE_USER 错误解决

 
在Hadoop全分布构建中,常常会出现以下错误

[root@Hadoopc1 hadoop]# start-all.sh
Starting namenodes on [192.168.13.245]
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 [Hadoopc1.localdomain]
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.

 这些错误都是因为缺少用户定义导致的

 解决

在  vi sbin/start-dfs.sh 

     vi sbin/stop-dfs.sh      

添加

HDFS_DATANODE_USER=root 
HADOOP_SECURE_DN_USER=hdfs 
HDFS_NAMENODE_USER=root 
HDFS_SECONDARYNAMENODE_USER=root    

vi sbin/start-yarn.sh 

vi sbin/stop-yarn.sh

添加

YARN_RESOURCEMANAGER_USER=root
HADOOP_SECURE_DN_USER=yarn
YARN_NODEMANAGER_USER=root

再执行就可以了

你可能感兴趣的:(笔记,Hadoop,hadoop,hdfs,big,data)