一、core-site.xml
<configuration>
<!-- 指定HDFS 中 NameNode 的地址 -->
<property>
<name>fs.defaultFS</name>
<value>hdfs://hadoop01:9000</value>
</property>
<!-- 指定 hadoop 运行时产生文件的存储目录 -->
<property>
<name>hadoop.tmp.dir</name>
<value>/home/hadoop/install/hadoop-2.5.0-cdh5.3.6/data/tmp</value>
</property>
</configuration>
export JAVA_HOME=/home/hadoop/install/jdk1.8.0_152/
三、hdfs-site.xml
<configuration>
<property>
<name>dfs.replication</name>
<value>3</value>
</property>
<property>
<name>dfs.namenode.secondary.http-address</name>
<value>hadoop03:50090</value>
</property>
</configuration>
四、slaves
hadoop01
hadoop02
hadoop03
export JAVA_HOME=/home/hadoop/install/jdk1.8.0_152/
六、yarn-site.xml
<configuration>
<!-- reducer 获取数据的方式 -->
<property>
<name>yarn.nodemanager.aux-services</name>
<value>mapreduce_shuffle</value>
</property>
<!-- 指定 YARN 的 ResourceManager 的地址 -->
<property>
<name>yarn.resourcemanager.hostname</name>
<value>hadoop03</value>
</property>
</configuration>
export JAVA_HOME=/home/hadoop/install/jdk1.8.0_152/
八、mapred-site.xml(此文件原来是mapred-site.xml)
应该先修改文件名:
mv mapred-site.xml.template mv mapred-site.xml
<configuration>
<!-- 指定 mr 运行在 yarn 上 -->
<property>
<name>mapreduce.framework.name</name>
<value>yarn</value>
</property>
</configuration>