配置歷史服務node
進入目錄 /opt/module/hadoop-2.7.7/etc/hadoop web
vim mapred-site.xml vim
增長曆史服務器的配置 服務器
<!-- 歷史服務器端地址 --> <property> <name>mapreduce.jobhistory.address</name> <value>hadooptest:10020</value> </property> <!-- 歷史服務器web端地址 --> <property> <name>mapreduce.jobhistory.webapp.address</name> <value>hadooptest:19888</value> </property>
hadooptest是本機hostnameapp
啓動歷史服務 webapp
sbin/mr-jobhistory-daemon.sh start historyserver oop
啓動後jps查看 ui
啓動成功後進入頁面 ip:19888 spa
配置日誌彙集3d
進入目錄 /opt/module/hadoop-2.7.7/etc/hadoop
vim 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>
關閉NodeManager 、ResourceManager和HistoryManager
sbin/yarn-daemon.sh stop resourcemanager
sbin/yarn-daemon.sh stop nodemanager
sbin/mr-jobhistory-daemon.sh stop historyserver
啓動NodeManager 、ResourceManager和HistoryManager
sbin/yarn-daemon.sh start resourcemanager
sbin/yarn-daemon.sh start nodemanager
sbin/mr-jobhistory-daemon.sh start historyserver
bin/hdfs dfs -rm -R /user/atguigu/output
hadoop jar share/hadoop/mapreduce/hadoop-mapreduce-examples-2.7.7.jar wordcount /user/lcy/input /user/lcy/output