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"?>


<!-- Put site-specific property overrides in this file. -->


<configuration>
    <property> 
        <name>fs.defaultFS</name> 
        <value>hdfs://fc20:9000</value> 
    </property> 


    <property> 
        <name>hadoop.tmp.dir</name> 
        <value>/home/ljq/hadoop/tmp</value>
    </property> 


    <property>
        <name>hadoop.native.lib</name>
        <value>false</value>
        <description>Should native hadoop libraries, if present, be used.</description>
    </property>
</configuration>


hdfs-site.xml:

<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>


<!-- Put site-specific property overrides in this file. -->


<configuration>
    <property> 
        <name>dfs.replication</name> 
        <value>1</value> 
    </property> 


    <property>
        <name>dfs.namenode.name.dir</name>
        <value>/home/ljq/hadoop/dfs/name</value>
    </property>


    <property>
        <name>dfs.datanode.data.dir</name>
        <value>/home/ljq/hadoop/dfs/data</value>
    </property>
</configuration>

mapred-site.xml:

<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>


<!-- Put site-specific property overrides in this file. -->


<configuration>
    <property>
        <name>mapreduce.framework.name</name>
        <value>yarn</value>  一定是小写yarn否则出现错误:java.lang.IllegalStateException: Invalid shuffle port number -1 
    </property>

   <property>
        <name>mapreduce.jobhistory.address</name> jobhistory 的web地址,需要手动启动
        <value>fc20:10020</value>
    </property>

    <property>
        <name>mapreduce.jobhistory.webapp.address</name>
        <value>fc20:10021</value>
    </property>


</configuration>


yarn-site.xml: 文件里所有yarn都必须小写,否则相应的端口信息找不到,会在默认端口上启动进程

<?xml version="1.0"?>
<configuration>


<!-- Site specific YARN configuration properties -->


    <property>
        <description>The hostname of the RM.</description> 
        <name>yarn.resourcemanager.hostname</name> 
        <value>fc20</value> 
    </property>

    <property> 
        <name>yarn.nodemanager.aux-services</name> 
        <value>mapreduce.shuffle</value> 
    </property>
 
    <property> 
        <description>The address of the applications manager interface in the RM.</description> 
        <name>yarn.resourcemanager.address</name> 
        <value>fc20:18004</value> 
    </property> 

    <property> 
        <description>The address of the scheduler interface.</description> 
        <name>yarn.resourcemanager.scheduler.address</name> 
        <value>fc20:18003</value> 
    </property> 

    <property> 
        <description>The address of the RM web application.</description> 
        <name>yarn.resourcemanager.webapp.address</name> 
        <value>fc20:18008</value> 
    </property> 
  
    <property> 
        <description>The address of the resource tracker interface.</description> 
        <name>yarn.resourcemanager.resource-tracker.address</name> 
        <value>fc20:18006</value> 
    </property> 


</configuration>

通过netstat可以看见相应端口已经启动

运行wordcount以及自己写的mapreduce可以成功完成!

另外jobhistory 不是随着hdfs和yarn的启动自动启动,而是需要手动启动,曾经为这个纳闷了好几天,
启动jobhistory进程:

$HADOOP_HOME/sbin/mr-jobhistory-daemon.sh start/stop historyserver


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

种菜的

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值