本文主要是介绍通过yarn提交任务出现Failed while trying to construct the redirect url to the log server. Log Server url may,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
1、在通过yarn-client模式提交任务时,打开http://master:8088/网页出现如下错误:
Failed while trying to construct the redirect url to the log server. Log Server url may not be configured
java.lang.Exception: Unknown container. Container either has not started or has already completed or doesn't belong to this node at all.
如下图所示:
2、而且显示任务是成功运行的,并且任务运行结果也出来了,如下图所示:
3、出现此问题是由于启动historyserver服务,默认情况关闭的,它是一个独立的服务,首先需要配置yarn-site.xml文件,在该配置文件中加入以下配置
<property><name>yarn.log.server.url</name><value>http://master:19888/jobhistory/logs</value>
</property>
如下图所示:
4、然后在mapred-site.xml中加入如下配置,端口是在yarn-site.xml中一样,是19888:
<property><name>mapreduce.jobhistory.address</name><value>master:10020</value></property><property><name>mapreduce.jobhistory.webapp.address</name><value>master:19888</value></property>
如下图所示:
5、将此更改的配置分发到其他节点上去,可通过如下命令进行分发:
scp /usr/local/src/hadoop-2.6.5/etc/hadoop/yarn-site.xml root@slave1:/usr/local/src/hadoop-2.6.5/etc/hadoop/
scp /usr/local/src/hadoop-2.6.5/etc/hadoop/yarn-site.xml root@slave2:/usr/local/src/hadoop-2.6.5/etc/hadoop/
scp /usr/local/src/hadoop-2.6.5/etc/hadoop/mapred-site.xml root@slave1:/usr/local/src/hadoop-2.6.5/etc/hadoop/
scp /usr/local/src/hadoop-2.6.5/etc/hadoop/mapred-site.xml root@slave2:/usr/local/src/hadoop-2.6.5/etc/hadoop/
6、在master上通过如下命令启动historyserver:
/usr/local/src/hadoop-2.6.5/sbin/mr-jobhistory-daemon.sh start historyserver
如下图所示:
7、此时可以打开http://master:19888查看页面了,如下图所示:
8、在次提交任务,点击日志进去,如下图所示:
9、再次点击here查看所有的日志:
这篇关于通过yarn提交任务出现Failed while trying to construct the redirect url to the log server. Log Server url may的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!