如何删除hadoop-3.2.0中的错误start-dfs.sh

qaxu7uf2  于 2021-05-27  发布在  Hadoop
关注(0)|答案(1)|浏览(451)

运行start-dfs.sh以启动hadoop服务时出现以下错误:

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

mbjcgjjk1#

在hadoop主目录中打开etc/hadoop/hadoop-env.sh文件并添加以下行以删除错误:

export HDFS_NAMENODE_USER=root
export HDFS_DATANODE_USER=root
export HDFS_SECONDARYNAMENODE_USER=root
export YARN_RESOURCEMANAGER_USER=root
export YARN_NODEMANAGER_USER=root

您可以通过在上述命令中替换root来添加用户名。

相关问题