当前位置:   article > 正文

hadoop启动报错:Attempting to operate on hdfs namenode as root_error: attempting to operate on hdfs namenode as r

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

解决方案1:

在环境变量中添加如下几个配置:

 

vim /etc/profile

添加

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
 

 

 

解决方案2:

 

写在最前注意:
1、master,slave都需要修改start-dfs.sh,stop-dfs.sh,start-yarn.sh,stop-yarn.sh四个文件
2、如果你的Hadoop是另外启用其它用户来启动,记得将root改为对应用户

HDFS格式化后启动dfs出现以下错误:

  1. [root@master sbin]# ./start-dfs.sh
  2. Starting namenodes on [master]
  3. ERROR: Attempting to operate on hdfs namenode as root
  4. ERROR: but there is no HDFS_NAMENODE_USER defined. Aborting operation.
  5. Starting datanodes
  6. ERROR: Attempting to operate on hdfs datanode as root
  7. ERROR: but there is no HDFS_DATANODE_USER defined. Aborting operation.
  8. Starting secondary namenodes [slave1]
  9. ERROR: Attempting to operate on hdfs secondarynamenode as root
  10. ERROR: but there is no HDFS_SECONDARYNAMENODE_USER defined. Aborting operation.

查度娘,见一仁兄的博客有次FAQ,故参考处理顺便再做一记录
参考地址:https://blog.csdn.net/u013725455/article/details/70147331

在/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
  5. # Licensed to the Apache Software Foundation (ASF) under one or more

修改后重启 ./start-dfs.sh,成功!

  1. [root@master sbin]# ./start-dfs.sh
  2. WARNING: HADOOP_SECURE_DN_USER has been replaced by HDFS_DATANODE_SECURE_USER. Using value of HADOOP_SECURE_DN_USER.
  3. Starting namenodes on [master]
  4. 上一次登录:日 63 03:01:37 CST 2018从 slave1pts/2
  5. master: Warning: Permanently added 'master,192.168.43.161' (ECDSA) to the list of known hosts.
  6. Starting datanodes
  7. 上一次登录:日 63 04:09:05 CST 2018pts/1
  8. Starting secondary namenodes [slave1]
  9. 上一次登录:日 63 04:09:08 CST 2018pts/1
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/菜鸟追梦旅行/article/detail/472751
推荐阅读
相关标签
  

闽ICP备14008679号