hadoop搭建四个配置文件(core-site.xml hdfs-site.xml mapred-site.xml yarn-site.xml )的简单介绍

来源:互联网 发布:材料库存软件 编辑:程序博客网 时间:2024/05/22 07:52

一 、core-site.xml

<configuration>        <!--指定namenode的地址-->    <property>                <name>fs.defaultFS</name>                <value>hdfs://master:9000</value>    </property>    <!--用来指定使用hadoop时产生文件的存放目录-->    <property>             <name>hadoop.tmp.dir</name>             <value>file:///usr/hadoop/hadoop-2.6.0/tmp</value>     </property>        <!--用来设置检查点备份日志的最长时间-->        <name>fs.checkpoint.period</name>         <value>3600</value> </configuration>

二 、hdfs-site.xml

<configuration>    <!--指定hdfs保存数据的副本数量-->    <property>            <name>dfs.replication</name>            <value>2</value>    </property>    <!--指定hdfs中namenode的存储位置-->    <property>             <name>dfs.namenode.name.dir</name>              <value>file:/usr/hadoop/hadoop-2.6.0/tmp/dfs/name</value>    </property>    <!--指定hdfs中datanode的存储位置-->    <property>             <name>dfs.datanode.data.dir</name>             <value>file:/usr/hadoop/hadoop-2.6.0/tmp/dfs/data</value>    </property></configuration>

三、 mapred-site.xml

<configuration><!--告诉hadoop以后MR(Map/Reduce)运行在YARN上-->        <property>              <name>mapreduce.framework.name</name>              <value>yarn</value>       </property></configuration>

四、 yarn-site.xml

<configuration>    <!--nomenodeManager获取数据的方式是shuffle-->        <property>                <name>yarn.nodemanager.aux-services</name>                <value>mapreduce_shuffle</value>        </property>    <!--指定Yarn的老大(ResourceManager)的地址-->         <property>            <name>yarn.resourcemanager.hostname</name>            <value>master</value>    </property>     <!--Yarn打印工作日志-->        <property>            <name>yarn.log-aggregation-enable</name>         <value>true</value>        </property><configuration>
阅读全文
0 0