您好,欢迎访问一九零五行业门户网

hadoop2.0 新一代map reduce 框架 yarn 配置

以前一直用的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
其它类似信息

推荐信息