Hadoop运行start-dfs.sh报ERROR: Attempting to operate on hdfs as root错误的解决方法
2021/12/3 6:08:33
本文主要是介绍Hadoop运行start-dfs.sh报ERROR: Attempting to operate on hdfs as root错误的解决方法,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
错误提示:
Starting namenodes on [master] 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 ERROR: Attempting to operate on hdfs secondarynamenode as root ERROR: but there is no HDFS_SECONDARYNAMENODE_USER defined. Aborting operation. Starting journal nodes ERROR: Attempting to operate on hdfs journalnode as root ERROR: but there is no HDFS_JOURNALNODE_USER defined. Aborting operation. Starting ZK Failover Controllers on NN hosts ERROR: Attempting to operate on hdfs zkfc as root ERROR: but there is no HDFS_ZKFC_USER defined. Aborting operation.
原因:
使用root账号启动服务,但没预先定义
解决方法:
* 该步骤需要在每台机都执行,也可以先在其中一台机修改,再用scp同步给其它机
1.修改start-dfs.sh和stop-dfs.sh
cd /home/hadoop/sbin vim start-dfs.sh vim stop-dfs.sh
在头部添加以下内容:
HDFS_ZKFC_USER=root HDFS_JOURNALNODE_USER=root HDFS_NAMENODE_USER=root HDFS_SECONDARYNAMENODE_USER=root HDFS_DATANODE_USER=root HDFS_DATANODE_SECURE_USER=root #HADOOP_SECURE_DN_USER=root
2.修改start-yarn.sh和stop-yarn.sh
cd /home/hadoop/sbin vim start-yarn.sh vim stop-yarn.sh
在头部添加以下内容:
#HADOOP_SECURE_DN_USER=root HDFS_DATANODE_SECURE_USER=root YARN_NODEMANAGER_USER=root YARN_RESOURCEMANAGER_USER=root
3.同步到其它机
cd /home/hadoop/sbin scp * c2:/home/hadoop/sbin scp * c3:/home/hadoop/sbin scp * c4:/home/hadoop/sbin
这篇关于Hadoop运行start-dfs.sh报ERROR: Attempting to operate on hdfs as root错误的解决方法的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!
- 2023-05-13Windows下hadoop环境搭建之NameNode启动报错
- 2023-04-14hadoop伪分布式集群的安装(不是单机版)
- 2022-12-05Hadoop生态系统—数据仓库Hive的安装
- 2022-11-02Win10搭建Hadoop环境
- 2022-10-19Hadoop生态系统(数据仓库Hive的安装)
- 2022-10-03Hadoop、storm和Spark Streaming简单介绍
- 2022-10-03胖虎的Hadoop笔记——Hadoop的伪分布式部署
- 2022-09-11Ubuntu搭建全分布式Hadoop
- 2022-09-11Ubuntu搭建全分布式Hadoop
- 2022-09-09Ubuntu下安装伪分布式HADOOP遇到的一些问题