Hadoop常见问题2 Attempting to operate on hdfs namenode as root but there is no HDFS_NAMENODE_USER define

Posted keep-go-on

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Hadoop常见问题2 Attempting to operate on hdfs namenode as root but there is no HDFS_NAMENODE_USER define相关的知识,希望对你有一定的参考价值。

问题原因

hadoop 试图使用root用户操作,但是在环境变量中没有配置使用的用户,所以终止了程序。

问题描述

Starting namenodes on [192.168.72.102]
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 [localhost.localdomain]
ERROR: Attempting to operate on hdfs secondarynamenode as root
ERROR: but there is no HDFS_SECONDARYNAMENODE_USER defined. Aborting operation.

解决方案

在 hadoop安装包下的 etc/hadoop/hadoop-env.sh 环境配置文件下添加如下配置

export HDFS_NAMENODE_USER=root
export HDFS_SECONDARYNAMENODE_USER=root
export HDFS_DATANODE_USER=root

以上是关于Hadoop常见问题2 Attempting to operate on hdfs namenode as root but there is no HDFS_NAMENODE_USER define的主要内容,如果未能解决你的问题,请参考以下文章

Hadoop常见问题2 Attempting to operate on hdfs namenode as root but there is no HDFS_NAMENODE_USER define

Hadoop常见问题2 Attempting to operate on hdfs namenode as root but there is no HDFS_NAMENODE_USER define

Hadoop3 启动,提示ERROR: Attempting to operate on hdfs namenode as root ***

TensorFlow问题“Attempting to use uninitialized value”

Error attempting to get column from result set

Attempting to fetch value instead of handling error Internal: failed to get device attribute 13 for