<property>
<name>dfs.namenode.name.dir</name>
<value>/home/dfs/name</value>
<description>
Directory where HDFS name node store the name table(fsimage).
</description>
</property>
<property>
<name>dfs.datanode.data.dir</name>
<value>/home/dfs/data</value>
<description>
Directory where HDFS data node store blocks.
</description>
</property>
<!-- NameNode和SecondaryNameNode分离的情况下,此项配置不可少,会影响SecondaryNameNode从NameNode拷贝镜像文件的存储,
不配置的话,NameNode宕机,Secondary找不着备份的镜像文件 -->
<property>
<name>dfs.namenode.checkpoint.dir</name>
<value>/home/dfs/namesecondary</value>
<description>
Determines where on the local filesystem the DFS secondary
name node should store the temporary images to merge.
</description>
</property>
<property>
<name>dfs.replication</name>
<value>2</value>
<description>
HDFS block replication.
</description>
</property>
<property>
<name>dfs.blocksize</name>
<value>134217728</value>
<description>
HDFS storage blocksize.
</description>
</property>
<!-- 将NameNode和SecondaryNameNode分离开的配置分别指定namenode和secondarynamenode的启动节点 -->
<property>
<name>dfs.namenode.http-address</name>
<value>namenode01:50070</value>
<description>
The address and the base port where the dfs namenode web ui will listen on.
</description>
</property>
<property>
<name>dfs.namenode.secondary.http-address</name>
<value>namenode02:50090</value>
<description>
The secondary namenode http server address and port.
</description>
</property>
<property>
<name>dfs.namenode.checkpoint.period</name>
<value>3600</value>
<description>
The number of seconds between two periodic checkpoints.
</description>
</property>
编辑mapred-site.xml,增加如下内容: