历史服务配置启动查看
1)配置mapred-site.xml
<property> <name>mapreduce.jobhistory.address</name> <value>hadoop-001:10020</value> </property> <property> <name>mapreduce.jobhistory.webapp.address</name> <value>hadoop-001:19888</value> </property> |
2)查看启动历史服务器文件目录:
[hadoop@hadoop-001 hadoop-2.7.2]# ls sbin/ |grep mr
mr-jobhistory-daemon.sh
3)启动历史服务器
sbin/mr-jobhistory-daemon.sh start historyserver
4)查看历史服务器是否启动
jps
5)查看jobhistory
http://hadoop-001:19888/jobhistory
日志的聚集
日志聚集概念:应用运行完成以后,将日志信息上传到HDFS系统上
开启日志聚集功能步骤:
(1)配置yarn-site.xml
<!-- 日志聚集功能使能 --> <property> <name>yarn.log-aggregation-enable</name> <value>true</value> </property> <!-- 日志保留时间设置7天 --> <property> <name>yarn.log-aggregation.retain-seconds</name> <value>604800</value> </property> |
(2)关闭nodemanager 、resourcemanager和historymanager
sbin/yarn-daemon.sh stop resourcemanager
sbin/yarn-daemon.sh stop nodemanager
sbin/mr-jobhistory-daemon.sh stop historyserver
(3)启动nodemanager 、resourcemanager和historymanager
sbin/yarn-daemon.sh start resourcemanager
sbin/yarn-daemon.sh start nodemanager
sbin/mr-jobhistory-daemon.sh start historyserver
(4)删除hdfs上已经存在的hdfs文件
bin/hdfs dfs -rm -R /gec/mapreduce/wordcount/output
(5)执行wordcount程序
hadoop jar share/hadoop/mapreduce/hadoop-mapreduce-examples-2.7.2.jar wordcount /gec/mapreduce/wordcount/input /gec/mapreduce/wordcount/output
(6)查看日志