运行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.
1条答案
按热度按时间mbjcgjjk1#
在hadoop主目录中打开etc/hadoop/hadoop-env.sh文件并添加以下行以删除错误:
您可以通过在上述命令中替换root来添加用户名。