你好,游客 登录 注册 搜索
背景:
阅读新闻

Hadoop2.0 配置yarn成功

[日期:2014-05-09] 来源:Linux社区  作者:ljq32 [字体:大 中 小]

Hadoop2.0 配置yarn成功,记住这个成功的一刻,把几个主要文件贴出来:

--------------------------------------分割线 --------------------------------------

相关阅读:

Ubuntu 13.04上搭建Hadoop环境 http://www.linuxidc.com/Linux/2013-06/86106.htm

Ubuntu 12.10 +Hadoop 1.2.1版本集群配置 http://www.linuxidc.com/Linux/2013-09/90600.htm

Ubuntu上搭建Hadoop环境(单机模式+伪分布模式) http://www.linuxidc.com/Linux/2013-01/77681.htm

Ubuntu下Hadoop环境的配置 http://www.linuxidc.com/Linux/2012-11/74539.htm

单机版搭建Hadoop环境图文教程详解 http://www.linuxidc.com/Linux/2012-02/53927.htm

Hadoop LZO 安装教程 http://www.linuxidc.com/Linux/2013-01/78397.htm

Hadoop集群上使用Lzo压缩 http://www.linuxidc.com/Linux/2012-05/60554.htm

--------------------------------------分割线 --------------------------------------
 
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可以成功完成!

更多Hadoop相关信息见Hadoop 专题页面 http://www.linuxidc.com/topicnews.aspx?tid=13

本文永久更新链接地址:http://www.linuxidc.com/Linux/2014-05/101448.htm

linux
相关资讯       Hadoop2.0  Hadoop2.0配置  Hadoop yarn 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款