yarn-daemon.sh在hdp中写入错误的日志目录

epfja78i  于 2021-06-02  发布在  Hadoop
关注(0)|答案(1)|浏览(486)

我已经在笔记本电脑上安装了hortonworks hdp版本2.2.4.2-2。我已经启动了hdfs服务,例如名称节点、辅助名称节点和所有数据节点。我可以通过名称节点web界面浏览hdfs。问题出在资源管理器上。hdp伴随文件为设置了错误的值 HADOOP_LIBEXEC_DIR . 已设置为 /usr/lib/hadoop/libexec 这是错误的。正确的地址是: /usr/hdp/2.2.4.2-2/hadoop/libexec . 在我更改此参数并使用此命令启动资源管理器之后(使用 yarn 用户):

/usr/hdp/current/hadoop-yarn-resourcemanager/sbin/yarn-daemon.sh --config /etc/hadoop/conf start resourcemanager

显示错误:

mkdir: cannot create directory `/var/log/hadoop-yarn': Permission denied
chown: cannot access `/var/log/hadoop-yarn/yarn': No such file or directory
mkdir: cannot create directory `/var/run/hadoop-yarn': Permission denied
starting resourcemanager, logging to /var/log/hadoop-yarn/yarn/yarn-yarn-resourcemanager-rm.hdp.local.out
/usr/hdp/current/hadoop-yarn-resourcemanager/sbin/yarn-daemon.sh: line 129: cd: /usr/lib/hadoop-yarn: No such file or directory
/usr/hdp/current/hadoop-yarn-resourcemanager/sbin/yarn-daemon.sh: line 131: /var/run/hadoop-yarn/yarn/yarn-yarn-resourcemanager.pid: No such file or directory
/usr/hdp/current/hadoop-yarn-resourcemanager/sbin/yarn-daemon.sh: line 130: /var/log/hadoop-yarn/yarn/yarn-yarn-resourcemanager-rm.hdp.local.out: No such file or directory
head: cannot open `/var/log/hadoop-yarn/yarn/yarn-yarn-resourcemanager-rm.hdp.local.out' for reading: No such file or directory
/usr/hdp/current/hadoop-yarn-resourcemanager/sbin/yarn-daemon.sh: line 135: /var/log/hadoop-yarn/yarn/yarn-yarn-resourcemanager-rm.hdp.local.out: No such file or directory
/usr/hdp/current/hadoop-yarn-resourcemanager/sbin/yarn-daemon.sh: line 136: /var/log/hadoop-yarn/yarn/yarn-yarn-resourcemanager-rm.hdp.local.out: No such file or directory

问题是 yarn-daemon.sh 根据我的环境变量使用了错误的日志目录:

[yarn@rm ~]$ echo ${YARN_LOCAL_DIR}
/hadoop/yarn/local
[yarn@rm ~]$ echo ${YARN_LOG_DIR}
/var/log/hadoop/yarn
[yarn@rm ~]$ echo ${YARN_LOCAL_LOG_DIR}
/hadoop/yarn/logs
[yarn@rm ~]$ echo ${YARN_PID_DIR}
/var/run/hadoop/yarn

这真的是虫子还是我做错了什么?

weylhg0b

weylhg0b1#

马吉德,
您正在使用的启动脚本,即/usr/hdp/current/hadoop-yarn-resourcemanager/sbin/yarn-daemon.sh,在本例中,它提供了位于您指定的配置目录中的yarn-env.sh脚本
--config/etc/hadoop/conf文件
这些环境变量很可能在脚本中被重写。如果您使用的是hortonwork提供的配套文件,那么它们确实被更改为:

export YARN_LOG_DIR=/var/log/hadoop-yarn/$USER
export YARN_PID_DIR=/var/run/hadoop-yarn/$USER
export HADOOP_LIBEXEC_DIR=/usr/lib/hadoop/libexec

最好将/etc/hadoop/yarn-env.sh脚本中的这些值更改为所需的值,然后重试

相关问题