yarn-daemon.sh 在 HDP 中写入错误的日志目录
yarn-daemon.sh writes to wrong log directory in HDP
我已经在笔记本电脑上安装了 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
这真的是一个错误还是我做错了什么?
马吉德,
您正在使用的启动脚本,即 /usr/hdp/current/hadoop-yarn-resourcemanager/sbin/yarn-daemon.sh 源位于您指定的配置目录中的 yarn-env.sh 脚本,在您的情况下
--配置/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 脚本中的这些值更改为您想要的值,然后重试
我已经在笔记本电脑上安装了 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
这真的是一个错误还是我做错了什么?
马吉德,
您正在使用的启动脚本,即 /usr/hdp/current/hadoop-yarn-resourcemanager/sbin/yarn-daemon.sh 源位于您指定的配置目录中的 yarn-env.sh 脚本,在您的情况下
--配置/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 脚本中的这些值更改为您想要的值,然后重试