本次配置的是hadoop2.8版本
1.配置環境變量HADOOP_HOME、Path(先下載hadoop2.8.5並進行解壓)
2.在hadoop路徑下創建data/namenode和data/datanode文件夾
3.修改文件core-site.xml、hdfs-site.xml(配置路徑一定要以/開頭)、httpfs-site.xml 、mapred-site.xml、yarn-site.xml
修改core-site.xml
<configuration>
<property>
<name>fs.defaultFS</name>
<value>hdfs://localhost:9000</value>
</property>
</configuration>
修改hdfs-site.xml
<configuration>
<property>
<name>dfs.replication</name>
<value>1</value>
</property>
<property>
<name>dfs.namenode.name.dir</name>
<value>/(你自己的hadoop路徑)/data/namenode</value>
</property>
<property>
<name>dfs.datanode.data.dir</name>
<value>/(你自己的hadoop路徑)/data/datanode</value>
</property>
</configuration>
修改httpfs-site.xml
<configuration>
<property>
<name>dfs.replication</name>
<value>1</value>
</property>
<property>
<name>dfs.namenode.name.dir</name>
<value>file:/hadoop/data/dfs/namenode</value>
</property>
<property>
<name>dfs.datanode.data.dir</name>
<value>file:/hadoop/data/dfs/datanode</value>
</property>
</configuration>
修改mapred-site.xml
<configuration>
<property>
<name>mapreduce.framework.name</name>
<value>yarn</value>
</property>
<property>
<name>mapred.job.tracker</name>
<value>hdfs://localhost:9001</value>
</property>
</configuration>
修改yarn-site.xml
<configuration>
<!-- Site specific YARN configuration properties -->
<property>
<name>yarn.nodemanager.aux-services</name>
<value>mapreduce_shuffle</value>
</property>
<property>
<name>yarn.nodemanager.aux-services.mapreduce.shuffle.class</name>
<value>org.apache.hadoop.mapred.ShuffleHandler</value>
</property>
</configuration>
4.在hadoop的bin文件夾中添加winutils.exe、hadoop.dll文件
見該鏈接選擇hadoop2.8.3的即可