二哈谈设计模式之建造者模式

leetcode 最长回文子串

  返回  

Attempting to operate on hdfs namenode as root

2021/7/21 18:18:19 浏览:

在操作中遇到Attempting to operate on hdfs namenode as root
百度顺便记录一下

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

[root@hadoop101 sbin]# start-dfs.sh
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 [slave1]
ERROR: Attempting to operate on hdfs secondarynamenode as root
ERROR: but there is no HDFS_SECONDARYNAMENODE_USER defined. Aborting operation.

在/hadoop/sbin路径下:
将start-dfs.sh,stop-dfs.sh两个文件顶部添加以下参数

#!/usr/bin/env bash
HDFS_DATANODE_USER=root
HADOOP_SECURE_DN_USER=hdfs
HDFS_NAMENODE_USER=root
HDFS_SECONDARYNAMENODE_USER=root

还有,start-yarn.sh,stop-yarn.sh顶部也需添加以下:

#!/usr/bin/env bash
YARN_RESOURCEMANAGER_USER=root
HADOOP_SECURE_DN_USER=yarn
YARN_NODEMANAGER_USER=root


# Licensed to the Apache Software Foundation (ASF) under one or more

修改后重启 start-dfs.sh

[root@hadoop101 sbin]# start-dfs.sh
WARNING: HADOOP_SECURE_DN_USER has been replaced by HDFS_DATANODE_SECURE_USER. Using value of HADOOP_SECURE_DN_USER.
Starting namenodes on [hadoop101]
上一次登录:三 7月 21 17:50:26 CST 2021pts/0 上
Starting datanodes
上一次登录:三 7月 21 17:57:19 CST 2021pts/0 上
hadoop102: datanode is running as process 2300.  Stop it first.
hadoop103: datanode is running as process 2152.  Stop it first.
hadoop101: datanode is running as process 3215.  Stop it first.
Starting secondary namenodes [hadoop103]
上一次登录:三 7月 21 17:57:21 CST 2021pts/0 上
hadoop103: secondarynamenode is running as process 2242.  Stop it first.

联系我们

如果您对我们的服务有兴趣,请及时和我们联系!

服务热线:18288888888
座机:18288888888
传真:
邮箱:888888@qq.com
地址:郑州市文化路红专路93号