hadoop搭建:历史服务配置启动

历史服务配置启动查看

(主机名:hadoop101)

1)配置mapred-site.xml

mapreduce.jobhistory.address
hadoop101:10020


mapreduce.jobhistory.webapp.address
hadoop101:19888

2)查看启动历史服务器文件目录:
[root@hadoop101 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://192.168.1.101:19888/jobhistory

日志的聚集

日志聚集概念:应用运行完成以后,将日志信息上传到HDFS系统上
开启日志聚集功能步骤:
(1)配置yarn-site.xml

yarn.log-aggregation-enable true yarn.log-aggregation.retain-seconds 604800 (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 /user/hadoop/mapreduce/wordcount/output

(5)执行wordcount程序

hadoop jar share/hadoop/mapreduce/hadoop-mapreduce-examples-2.5.0.jar wordcount /user/hadoop/mapreduce/wordcount/input /user/hadoop/mapreduce/wordcount/output

	(6)查看日志

http://192.168.1.101:19888/jobhistory

你可能感兴趣的:(hadoop搭建)