網(wǎng)站首頁 編程語言 正文
ERROR: but there is no HDFS_NAMENODE_USER defined. Aborting operation.
作者:yaoshengting 更新時(shí)間: 2022-02-17 編程語言執(zhí)行hadoop的start-all.sh命令式啟動(dòng)報(bào)如下的錯(cuò)誤
[root@iZbp13pwlxqwiu1xxb6szsZ hadoop-3.2.1]# 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@iZbp13pwlxqwiu1xxb6szsZ hadoop-3.2.1]#
解決方法:
方法一、
在Hadoop安裝目錄下找到sbin文件夾
在里面修改四個(gè)文件
1、對(duì)于start-dfs.sh和stop-dfs.sh文件,添加下列參數(shù):
#!/usr/bin/env bash
HDFS_DATANODE_USER=root
HADOOP_SECURE_DN_USER=hdfs
HDFS_NAMENODE_USER=root
HDFS_SECONDARYNAMENODE_USER=root
2、對(duì)于start-yarn.sh和stop-yarn.sh文件,添加下列參數(shù):
#!/usr/bin/env bash
YARN_RESOURCEMANAGER_USER=root
HADOOP_SECURE_DN_USER=yarn
YARN_NODEMANAGER_USER=root
然后重新啟動(dòng)
方法二、(推薦)
The root cause of this problem,
- hadoop install for different user and you start yarn service for different user. OR
- in hadoop config's hadoop-env.sh specified HDFS_NAMENODE_USER and HDFS_DATANODE_USER user is something else.
Hence we need to correct and make it consistent at every place. So a simple solution of this problem is to edit your?hadoop-env.sh
?file and add the user-name for which you want to start the yarn service. So go ahead and edit?$HADOOP_HOME/etc/hadoop/hadoop-env.sh
?by adding the following lines
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
Now save and start yarn, hdfs service and check that it works.
我們?cè)趆adoop-env.sh文件中也可以找到如下的描述
To prevent accidents, shell commands be (superficially) locked to only allow certain users to execute certain subcommands.
為了防止發(fā)生意外,僅(部分)鎖定shell命令以僅允許某些用戶執(zhí)行某些子命令。
It uses the format of (command)_(subcommand)_USER.For example, to limit who can execute the namenode command,export HDFS_NAMENODE_USER=hdfs
使用“命令_子命令_用戶”,例如,通過使用export HDFS_NAMENODE_USER=hdfs來限制哪個(gè)用戶可以執(zhí)行namenode命令。
參考stackoverflow上的相關(guān)討論
HDFS_NAMENODE_USER, HDFS_DATANODE_USER & HDFS_SECONDARYNAMENODE_USER not defined
原文鏈接:https://blog.csdn.net/ystyaoshengting/article/details/103026872
相關(guān)推薦
- 2023-03-19 詳解OpenMP的線程同步機(jī)制_C 語言
- 2022-10-23 ASP.NET?Core實(shí)現(xiàn)中間件的幾種方式_實(shí)用技巧
- 2022-06-29 Python容器類型轉(zhuǎn)換的3種方法實(shí)例_python
- 2022-07-18 使用d2l包和相關(guān)環(huán)境配置的一些血淚心得
- 2022-09-11 Oracle學(xué)習(xí)筆記之視圖及索引的使用_oracle
- 2022-06-06 ASP.NET的Core?AD域登錄過程示例_ASP.NET
- 2022-11-11 詳解React?Native項(xiàng)目中啟用Hermes引擎_React
- 2022-08-23 Python可視化模塊altair的使用詳解_python
- 最近更新
-
- window11 系統(tǒng)安裝 yarn
- 超詳細(xì)win安裝深度學(xué)習(xí)環(huán)境2025年最新版(
- Linux 中運(yùn)行的top命令 怎么退出?
- MySQL 中decimal 的用法? 存儲(chǔ)小
- get 、set 、toString 方法的使
- @Resource和 @Autowired注解
- Java基礎(chǔ)操作-- 運(yùn)算符,流程控制 Flo
- 1. Int 和Integer 的區(qū)別,Jav
- spring @retryable不生效的一種
- Spring Security之認(rèn)證信息的處理
- Spring Security之認(rèn)證過濾器
- Spring Security概述快速入門
- Spring Security之配置體系
- 【SpringBoot】SpringCache
- Spring Security之基于方法配置權(quán)
- redisson分布式鎖中waittime的設(shè)
- maven:解決release錯(cuò)誤:Artif
- restTemplate使用總結(jié)
- Spring Security之安全異常處理
- MybatisPlus優(yōu)雅實(shí)現(xiàn)加密?
- Spring ioc容器與Bean的生命周期。
- 【探索SpringCloud】服務(wù)發(fā)現(xiàn)-Nac
- Spring Security之基于HttpR
- Redis 底層數(shù)據(jù)結(jié)構(gòu)-簡(jiǎn)單動(dòng)態(tài)字符串(SD
- arthas操作spring被代理目標(biāo)對(duì)象命令
- Spring中的單例模式應(yīng)用詳解
- 聊聊消息隊(duì)列,發(fā)送消息的4種方式
- bootspring第三方資源配置管理
- GIT同步修改后的遠(yuǎn)程分支