...
以前一直用的0.20的map reduce框架,今天配置一下yarn,很久不写 BO-KE 了,来一篇吧,把几个主要配置文件贴出来,配置修改后,运行wordcount和自己的测试job全ok, core-site.xml: ?xml version=1.0? ?xml-stylesheet type=text/xsl href=configuration.xsl? !-- P
以前一直用的0.20的map reduce框架,今天配置一下yarn,很久不写 BO-KE 了,来一篇吧,把几个主要配置文件贴出来,配置修改后,运行wordcount和自己的测试job全ok,
core-site.xml:
fs.defaultFS
hdfs://fc20:9000
hadoop.tmp.dir
/home/ljq/hadoop/tmp
hadoop.native.lib
false
Should native hadoop libraries, if present, be used.
hdfs-site.xml:
dfs.replication
1
dfs.namenode.name.dir
/home/ljq/hadoop/dfs/name
dfs.datanode.data.dir
/home/ljq/hadoop/dfs/data
mapred-site.xml:
mapreduce.framework.name
yarn 一定是小写yarn否则出现错误:java.lang.IllegalStateException: Invalid shuffle port number -1
mapreduce.jobhistory.address jobhistory 的web地址,需要手动启动
fc20:10020
mapreduce.jobhistory.webapp.address
fc20:10021
yarn-site.xml: 文件里所有yarn都必须小写,否则相应的端口信息找不到,会在默认端口上启动进程
The hostname of the RM.
yarn.resourcemanager.hostname
fc20
yarn.nodemanager.aux-services
mapreduce.shuffle
The address of the applications manager interface in the RM.
yarn.resourcemanager.address
fc20:18004
The address of the scheduler interface.
yarn.resourcemanager.scheduler.address
fc20:18003
The address of the RM web application.
yarn.resourcemanager.webapp.address
fc20:18008
The address of the resource tracker interface.
yarn.resourcemanager.resource-tracker.address
fc20:18006
通过netstat可以看见相应端口已经启动
运行wordcount以及自己写的mapreduce可以成功完成!
另外jobhistory 不是随着hdfs和yarn的启动自动启动,而是需要手动启动,曾经为这个纳闷了好几天,
启动jobhistory进程:
$HADOOP_HOME/sbin/mr-jobhistory-daemon.sh start/stop historyserver