当前位置:   article > 正文

Hadoop3 启动,提示ERROR: Attempting to operate on hdfs namenode as root ***_starting namenodes on [xueai] error: attempting to

starting namenodes on [xueai] error: attempting to operate on hdfs namenode

在CentOS-7 搭建伪分布式Hadoop3 测试环境,执行start-all.sh 提示如下错误信息:

  1. Starting namenodes on [namenode]
  2. ERROR: Attempting to operate on hdfs namenode as root
  3. ERROR: but there is no HDFS_NAMENODE_USER defined. Aborting operation.
  4. Starting datanodes
  5. ERROR: Attempting to operate on hdfs datanode as root
  6. ERROR: but there is no HDFS_DATANODE_USER defined. Aborting operation.
  7. Starting secondary namenodes [datanode1]
  8. ERROR: Attempting to operate on hdfs secondarynamenode as root
  9. ERROR: but there is no HDFS_SECONDARYNAMENODE_USER defined. Aborting operation.
  10. Starting resourcemanager
  11. ERROR: Attempting to operate on yarn resourcemanager as root
  12. ERROR: but there is no YARN_RESOURCEMANAGER_USER defined. Aborting operation.
  13. Starting nodemanagers
  14. ERROR: Attempting to operate on yarn nodemanager as root
  15. ERROR: but there is no YARN_NODEMANAGER_USER defined. Aborting operation.

造成此问题的原因是:将Hadoop各进程(NameNode、DataNode、SECONDARYNAMENODE、ResourceManager、NodeManager)用户设置为root,而start-dfs.sh/stop-dfs.sh、start-yarn.sh/stop-yarn.sh 脚本没有添加root 账户声明。

解决办法:

在start-dfs.sh/stop-dfs.sh 开头处添加如下代码片段:

  1. HDFS_DATANODE_USER=root
  2. HADOOP_SECURE_DN_USER=hdfs
  3. HDFS_NAMENODE_USER=root
  4. HDFS_SECONDARYNAMENODE_USER=root

在start-yarn.sh/stop-yarn.sh 开头处添加如下代码片段:

  1. YARN_RESOURCEMANAGER_USER=root
  2. HADOOP_SECURE_DN_USER=yarn
  3. YARN_NODEMANAGER_USER=root
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/2023面试高手/article/detail/629403
推荐阅读
相关标签
  

闽ICP备14008679号