Run hadoop2.7.2 under Windows

Source: Internet
Author: User
Tags hdfs dfs hadoop fs

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.