1.配置mapred-site.xml
vim /opt/model/hadoop-3.1.3/etc/hadoop/mapred-site.xml
在该文件中增加如下配置
<property>
<name>mapreduce.jobhistory.address</name>
<value>192.168.10.51:10020</value>
</property>
<property>
<name>mapreduce.jobhistory.webapp.address</name>
<value>192.168.10.51:19888</value>
</property>
配置完之后分发到个个服务器
xsync mapred-site.xml

2.关闭yarn
stop-yarn.sh
start-yarn.sh
3.启动历史服务器
mapred --daemon start historyserver
jps
mapred是在hadoop中bin目录下的 
4.查看jobHistory
http://192.168.10.51:19888/jobhistory
5.测试
在hdfs上上传一个文件然后在执行计算
hadoop fs -mkdir /input
hadoop fs -put wcinput/word.txt /input
hadoop jar share/hadoop/mapreduce/hadoop-mapreduce-examples-3.1.3.jar wordcount /input /output
然后我们打开http://192.168.10.52:8088/cluster可以看到有个任务在计算执行  这个执行到一半报这个错  传送门添加链接描述
|