按照官网步骤sbin/start-yarn.sh失败

按照官网步骤sbin/start-yarn.sh失败

  • 环境
  • sbin/start-yarn.sh 启动失败
  • sbin/stop-yarn.sh 执行失败

环境

Centos7 - 1台虚拟机
hadoop-3.2.1
OpenJDK1.8.0_181
root用户 - 伪分布式

sbin/start-yarn.sh 启动失败

[root@ip10 hadoop-3.2.1]# sbin/start-yarn.sh 
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.

sbin/stop-yarn.sh 执行失败

[root@ip10 hadoop-3.2.1]# sbin/stop-yarn.sh
Stopping nodemanagers
ERROR: Attempting to operate on yarn nodemanager as root
ERROR: but there is no YARN_NODEMANAGER_USER defined. Aborting operation.
Stopping resourcemanager
ERROR: Attempting to operate on yarn resourcemanager as root
ERROR: but there is no YARN_RESOURCEMANAGER_USER defined. Aborting operation.
[root@ip10 hadoop-3.2.1]# jps
19010 Jps
18379 ResourceManager
18525 NodeManager

解决方案,即第一篇文章里不明白为什么要加的那两段代码
在 sbin/stop-yarn.sh ,sbin/start-yarn.sh 脚本里*顶部*添加如下代码

YARN_RESOURCEMANAGER_USER=root
HADOOP_SECURE_DN_USER=yarn
YARN_NODEMANAGER_USER=root

脚本里添加如上代码,问题即可解决.

[root@ip10 hadoop-3.2.1]# sbin/start-yarn.sh 
Starting resourcemanager
上一次登录:日 5月 17 22:51:11 CST 2020pts/0 上
Starting nodemanagers
上一次登录:日 5月 17 22:57:01 CST 2020pts/0 上
[root@ip10 hadoop-3.2.1]# sbin/stop-yarn.sh 
Stopping nodemanagers
上一次登录:日 5月 17 22:57:03 CST 2020pts/0 上
Stopping resourcemanager
上一次登录:日 5月 17 22:57:18 CST 2020pts/0 上
[root@ip10 hadoop-3.2.1]# 

报应来得太快,就像龙卷风..

你可能感兴趣的:(hadoop生态,linux,centos,hadoop)