日志聚集概念:应用运行完成之后,将程序运行信息上传到HDFS系统上
注意:开启日志聚集功能:需要重启NodeManager、ResourceManager和HistoryManager
首先是:
关闭历史服务器:
sbin/mr-jobhistory-daemon.sh stop historyserver
sbin/yarn-daemon.sh stop resourcemanager
sbin/yarn-daemon.sh stop nodemanager
1、配置yarn-site.xml
<!--日志聚集功能--> <property> name>yarn.log-aggregation-enable</value>true> 日志保留时间设置为7天>yarn.log-aggregation-retair-seconds>604800>
2、重启NodeManager、ResourceManager和HistoryManager
bin/hdfs dfs -rm -r /user/gong/output
重新运行wordcount:bin/hadoop jar share/hadoop/mapreduce/hadoop-mapreduce-examples-2.9.2.jar wordcount /user/gong/input /user/gong/output
4、查看
此时再点击logs就会发现有日志啦: