安裝方法:https://www.yiibai.com/hadoop/hadoop_enviornment_setup.html
一 、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>
hadoop3版本問題請參照:https://blog.csdn.net/qq_32635069/article/details/80859790