当前位置:   article > 正文

hadoop ERROR: Attempting to operate on hdfs namenode as root ERROR: but there is no HDFS_NAMENODE_US

error: attempting to operate on hdfs namenode as root error: but there is no

[root@master ~]# 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 [master]
ERROR: Attempting to operate on hdfs secondarynamenode as root
ERROR: but there is no HDFS_SECONDARYNAMENODE_USER defined. Aborting operation.
解决方法:

Hadoop安装目录下找到sbin文件夹

在里面修改四个文件

对于start-dfs.sh和stop-dfs.sh文件,添加下列参数:

  1. #!/usr/bin/env bash
  2. HDFS_DATANODE_USER=root
  3. HADOOP_SECURE_DN_USER=hdfs
  4. HDFS_NAMENODE_USER=root
  5. HDFS_SECONDARYNAMENODE_USER=root

对于start-yarn.sh和stop-yarn.sh文件,添加下列参数:

  1. #!/usr/bin/env bash
  2. YARN_RESOURCEMANAGER_USER=root
  3. HADOOP_SECURE_DN_USER=yarn
  4. YARN_NODEMANAGER_USER=root

重新开始start...就可以了。 

 

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/繁依Fanyi0/article/detail/629415
推荐阅读
相关标签
  

闽ICP备14008679号