码迷,mamicode.com
首页 > 其他好文 > 详细

hadoop2.0 配置yarn成功

时间:2014-05-09 00:35:27      阅读:342      评论:0      收藏:0      [点我收藏+]

标签:hadoop   hdfs   yarn   

很久不写 BO-KE 了,来一篇吧,记住这个成功的一刻,把几个主要文件贴出来:

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>

</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可以成功完成!



hadoop2.0 配置yarn成功,布布扣,bubuko.com

hadoop2.0 配置yarn成功

标签:hadoop   hdfs   yarn   

原文地址:http://blog.csdn.net/ljq32/article/details/25336545

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!