赞
踩
环境:hadoop-3.1.3
hadoop-3.1.3启动hadoop集群时还有可能可能会报如下错误信息:
[root@hadoop hadoop]# start-all.sh Starting namenodes on [iZbp13pwlxqwiu1xxb6szsZ] 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 [iZbp13pwlxqwiu1xxb6szsZ] ERROR: Attempting to operate on hdfs secondarynamenode as root ERROR: but there is no HDFS_SECONDARYNAMENODE_USER defined. Aborting operation. Starting resourcemanager ERROR: Attempting to operate on yarn resourcemanager as root ERROR: but there is no YARN_RESOURCEMANAGER_USER defined. Aborting operation. Starting nodemanagers ERROR: Attempting to operate on yarn nodemanager as root ERROR: but there is no YARN_NODEMANAGER_USER defined. Aborting operation. [root@hadoop hadoop]#
使用root账号启动服务,但没预先定义,缺少用户定义造成的。
分别编辑开始和关闭脚本
进入hadoop sbin目录
cd $HADOOP_HOME/sbin
vim start-dfs.sh
vim stop-dfs.sh
头部添加以下内容#!/usr/bin/env bash HDFS_DATANODE_USER=root HADOOP_SECURE_DN_USER=hdfs HDFS_NAMENODE_USER=root HDFS_SECONDARYNAMENODE_USER=root
- 1
- 2
- 3
- 4
- 5
vim start-yarn.sh
vim stop-yarn.sh
头部添加以下内容#!/usr/bin/env bash YARN_RESOURCEMANAGER_USER=root HADOOP_SECURE_DN_USER=yarn YARN_NODEMANAGER_USER=root
- 1
- 2
- 3
- 4
修改完重启即可
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。