TOP

Attempting to operate on hdfs namenode as root
2019-02-15 12:13:19 】 浏览:665
Tags:Attempting operate hdfs namenode root

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/lglglgl/article/details/80553828

写在最前注意:
1、master,slave都需要修改start-dfs.sh,stop-dfs.sh,start-yarn.sh,stop-yarn.sh四个文件
2、如果你的Hadoop是另外启用其它用户来启动,记得将root改为对应用户

HDFS格式化后启动dfs出现以下错误:

[root@master sbin]# ./start-dfs.sh
Starting namenodes on [master]
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 [slave1]
ERROR: Attempting to operate on hdfs secondarynamenode as root
ERROR: but there is no HDFS_SECONDARYNAMENODE_USER defined. Aborting operation.

查度娘,见一仁兄的博客有次FAQ,故参考处理顺便再做一记录
参考地址:https://blog.csdn.net/u013725455/article/details/70147331

在/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


# Licensed to the Apache Software Foundation (ASF) under one or more

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

[root@master sbin]# ./start-dfs.sh
WARNING: HADOOP_SECURE_DN_USER has been replaced by HDFS_DATANODE_SECURE_USER. Using value of HADOOP_SECURE_DN_USER.
Starting namenodes on [master]
上一次登录:日 6月  3 03:01:37 CST 2018从 slave1pts/2 上
master: Warning: Permanently added 'master,192.168.43.161' (ECDSA) to the list of known hosts.
Starting datanodes
上一次登录:日 6月  3 04:09:05 CST 2018pts/1 上
Starting secondary namenodes [slave1]
上一次登录:日 6月  3 04:09:08 CST 2018pts/1 上

Attempting to operate on hdfs namenode as root https://www.cppentry.com/bencandy.php?fid=115&id=208902

】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇idea运行workcount拒绝连接hdfs 下一篇hadoop之HDFS:CentOS安装和部署H..