您现在的位置是:首页 > 个人博客日记 个人博客日记

Hadoop ERROR: but there is no HDFS_NAMENODE_USER defined. Aborting operation. Starting datanodes

2019-08-22 15:35:41

1、使用root配置的hadoop并启动会出现报错

  1. [root@iZbp153yczpm4pp9pjs0u3Z sbin]# start-all.sh
  2. Starting namenodes on [hdp-01]
  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 [47.96.106.223]
  9. ERROR: Attempting to operate on hdfs secondarynamenode as root
  10. ERROR: but there is no HDFS_SECONDARYNAMENODE_USER defined. Aborting operation.
  11. Starting resourcemanager
  12. ERROR: Attempting to operate on yarn resourcemanager as root
  13. ERROR: but there is no YARN_RESOURCEMANAGER_USER defined. Aborting operation.
  14. Starting nodemanagers
  15. ERROR: Attempting to operate on yarn nodemanager as root
  16. ERROR: but there is no YARN_NODEMANAGER_USER defined. Aborting operation.

解决方法:

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

在里面修改四个文件

1、对于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

2、对于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…就可以。

2.报错

  1. [root@iZbp153yczpm4pp9pjs0u3Z sbin]# start-all.sh
  2. Starting namenodes on [hdp-01]
  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 [47.96.106.223]
  9. ERROR: Attempting to operate on hdfs secondarynamenode as root
  10. ERROR: but there is no HDFS_SECONDARYNAMENODE_USER defined. Aborting operation.
  11. Starting resourcemanager
  12. ERROR: Attempting to operate on yarn resourcemanager as root
  13. ERROR: but there is no YARN_RESOURCEMANAGER_USER defined. Aborting operation.
  14. Starting nodemanagers
  15. ERROR: Attempting to operate on yarn nodemanager as root
  16. ERROR: but there is no YARN_NODEMANAGER_USER defined. Aborting operation.

解决方法:

创建服务器与服务器之间免密登陆

  1. 命令:ssh-copy-id -i ~/.ssh/id_rsa.pub [romte_ip]

如下

  1. [root@iZbp153yczpm4pp9pjs0u3Z .ssh]# ssh-copy-id -i ~/.ssh/id_rsa.pub 47.96.106.223
  2. /usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/root/.ssh/id_rsa.pub"
  3. /usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
  4. /usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
  5. root@47.96.106.223's password:
  6. [root@iZbp153yczpm4pp9pjs0u3Z .ssh]# ssh-copy-id -i ~/.ssh/id_rsa.pub 47.96.106.223
  7. /usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/root/.ssh/id_rsa.pub"
  8. /usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
  9. /usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
  10. root@47.96.106.223's password:
  11. Number of key(s) added: 1
  12. Now try logging into the machine, with: "ssh '47.96.106.223'"
  13. and check to make sure that only the key(s) you wanted were added.

重新开始start…就可以。



关注TinyMeng博客,更多精彩分享,敬请期待!
 

站点信息