JobHistory
JobHistory是什么
- JobHistory用来记录已经finished的mapreduce运行日志,日志信息存放于HDFS目录中,默认情况下没有开启此功能,需要在mapred-site.xml、yarn-site.xml配置,并手动启动。
JobHistory怎么用
-
mapred-site.xml配置中添加
<property> <name>mapreduce.jobhistory.address</name> <value>hadoop01:10020</value> <description>MapReduce JobHistory Server IPC host:port</description> </property> <property> <name>mapreduce.jobhistory.webapp.address</name> <value>hadoop01:19888</value> <description>MapReduce JobHistory Server Web UI host:port</description> </property> <property> <name>mapreduce.jobhistory.done-dir</name> <value>/history/done</value> </property> <property> <name>mapreduce.jobhistory.intermediate-done-dir</name> <value>/history/done_intermediate</value> </property>
- yarn-site.xml配置中添加
<property> <name>yarn.log-aggregation-enable</name> <value>true</value> </property>
- 手动启动
1. 定位到hadoop的sbin下 2. sh mr-jobhistory-daemon.sh start historyserver
执行一个mapreduce实例
- 定位到hadoop的/share/hadoop/mapreduce下
- 执行一个实例
- hadoop jar hadoop-mapreduce-examples-2.6.0-cdh5.7.0.jar pi 2 3