当前位置:   article > 正文

hadoop集群启动失败YARN_RESOURCEMANAGER_USER=root HADOOP_SECURE_DN_USER=yarn YARN_NODEMANAGER_USER=root_error: attempting to operate on yarn nodemanager a

error: attempting to operate on yarn nodemanager as root error: but there is

 

  1. [root@hadoop102 job]# myhadoop.sh start
  2. =================== 启动 hadoop集群 ===================
  3. --------------- 启动 hdfs ---------------
  4. Starting namenodes on [hadoop102]
  5. Starting datanodes
  6. ERROR: Attempting to operate on hdfs namenode as root
  7. ERROR: but there is no HDFS_NAMENODE_USER defined. Aborting operation.
  8. ERROR: Attempting to operate on hdfs datanode as root
  9. ERROR: but there is no HDFS_DATANODE_USER defined. Aborting operation.
  10. Starting secondary namenodes [hadoop104]
  11. ERROR: Attempting to operate on hdfs secondarynamenode as root
  12. ERROR: but there is no HDFS_SECONDARYNAMENODE_USER defined. Aborting operation.
  13. --------------- 启动 yarn ---------------
  14. Starting resourcemanager
  15. Starting nodemanagers
  16. ERROR: Attempting to operate on yarn resourcemanager as root
  17. ERROR: but there is no YARN_RESOURCEMANAGER_USER defined. Aborting operation.
  18. ERROR: Attempting to operate on yarn nodemanager as root
  19. ERROR: but there is no YARN_NODEMANAGER_USER defined. Aborting operation.
  20. --------------- 启动 historyserver ---------------
  21. historyserver is running as process 13059. Stop it first.

错误原因:

Hadoop中没有默认root的用户,需要手动添加 

两种解决方法 

1、输入如下命令,在环境变量中添加下面的配置 ,然后向里面加入如下的内容。输入命令使改动生效

vi /etc/profile
  1. export HDFS_NAMENODE_USER=root
  2. export HDFS_DATANODE_USER=root
  3. export HDFS_SECONDARYNAMENODE_USER=root
  4. export YARN_RESOURCEMANAGER_USER=root
  5. export YARN_NODEMANAGER_USER=root
source /etc/profile

 

 

 2、方案1不成功使用2方案hadoop中sbin路径下文件

添加再顶部

  1. vim start-dfs.sh
  2. 添加:
  3. HDFS_DATANODE_USER=root
  4. HADOOP_SECURE_DN_USER=hdfs
  5. HDFS_NAMENODE_USER=root
  6. HDFS_SECONDARYNAMENODE_USER=root
  1. vim stop-dfs.sh
  2. 添加:
  3. HDFS_DATANODE_USER=root
  4. HADOOP_SECURE_DN_USER=hdfs
  5. HDFS_NAMENODE_USER=root
  6. HDFS_SECONDARYNAMENODE_USER=root
  1. vim start-yarn.sh
  2. 添加:
  3. YARN_RESOURCEMANAGER_USER=root
  4. HADOOP_SECURE_DN_USER=yarn
  5. YARN_NODEMANAGER_USER=root
  1. vim stop-yarn.sh
  2. 添加:
  3. YARN_RESOURCEMANAGER_USER=root
  4. HADOOP_SECURE_DN_USER=yarn
  5. YARN_NODEMANAGER_USER=root
  1. vim /etc/selinux/config
  2. 修改:
  3. SELINUX=enforcing 改为 SELINUX=disabled

 最后分发到其他节点

 

 

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

闽ICP备14008679号