Log Aggregation

日志聚集

sudo gedit etc/hadoop/yarn-site.xml 

增加以下配置信息启动日志服务器

<property>
    <name>yarn.nodemanager.aux-services</name>
    <value>mapreduce_shuffle</value>
</property>

<property>
    <name>yarn.resourcemanager.hostname</name>
    <value>hw-TM1612</value>
</property>
##  是否开启日志聚集服务
<property>
    <name>yarn.log-aggregation-enable</name>
    <value>true</value>
</property>
##  日志保存时间 7天
<property>  
    <name>yarn.log-aggregation.retain-seconds</name>
    <value>640800</value>
</property>

重新启动yarn服务

 sudo sbin/yarn-daemon.sh stop resourcemanager
 sudo sbin/yarn-daemon.sh stop nodemanager
 sudo sbin/mr-jobhistory-daemon.sh stop historyserver
 sudo sbin/yarn-daemon.sh start resourcemanager
 sudo sbin/yarn-daemon.sh start nodemanager
 sudo sbin/mr-jobhistory-daemon.sh start historyserver
 sudo bin/yarn jar share/hadoop/mapreduce/hadoop-mapreduce-examples-2.6.0-cdh5.5.0.jar wordcount /user/hw/mapreduce/wordcount/input/ /user/hw/mapreduce/wordcount/output2