1. Download hadoop-2.7.2.tar.gz
2. Unzip to D:\hadoop\
3. Configuring Hadoop_home Environment variables
4. Add the%hadoop_home%\bin directory to the PATH environment variable
5. Configure the JAVA_HOME environment variable, note that the path does not have spaces
6. Download the Hadoop-common-bin Toolkit (note that the version of Hadoop to correspond to, otherwise the HDFS command may be error), the bin directory under the Winutils.exe, Hadoop.dll, and so copy all to Hadoop_home\ Bin directory and replace the same name file
7. Configure the Hadoop configuration file (under the hadoop/etc/hadoop/directory)
A. Core-site.xml
<Configuration>
<property>
<name>hadoop.tmp.dir</name>
<value>file:/hadoop/hadoop272/tmp</value>
<description>abase for other temporary directories.</description>
</property>
<Property>
<name>fs.defaultfs</ name >
< value > hdfs://localhost:9000</ value >
< EM id= "__mcedel" > </ property >
</configuration>
B. hdfs-site.xml
<Configuration> < Property> <name>Dfs.permissions</name> <value>False</value> </ Property> < Property> <name>Dfs.replication</name> <value>1</value> </ Property> < Property> <name>Dfs.namenode.name.dir</name> <value>File:/hadoop/hadoop272/data/dfs/namenode</value> </ Property> < Property> <name>Dfs.datanode.data.dir</name> <value>File:/hadoop/hadoop272/data/dfs/datanode</value> </ Property> </Configuration>
C. maprd-site.xml
<Configuration> < Property> <name>Mapreduce.framework.name</name> <value>Yarn</value> </ Property></Configuration>
D. yarn-site.xml
<Configuration> < 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>
8. Format HDFs: Executing in the bin directory: HDFs Namenode–format
9. Start Hadoop: Execute in sbin directory: Start-all.cmd
10. See if the process started successfully: JPS
11. Visit:
hdfs:http://localhost:50070
yarn:http://localhost:8088/
12. Create directory: Perform HDFs dfs–mkdir/user (or Hadoop fs–mkdir/user) in the bin directory
13. Viewing the directory: executing in the bin directory: HDFs dfs-ls/user
14. Create file: Execute in Bin directory: HDFs dfs–put test.txt/user/
15. View files: Executing in the bin directory: HDFs dfs–cat/user/test.txt
Run hadoop2.7.2 under Windows