Hadoop 2.4 pseudo-distributed mode

Source: Internet
Author: User
Tags hadoop fs

1. core-site.xml

In <configuration> </configuration>, insert

     <property>            <name>fs.default.name</name>            <value>hdfs://localhost:9000</value>     </property>     <property>             <name>dfs.replication</name>             <value>1</value>     </property>     <property>              <name>hadoop.tmp.dir</name>              <value>/home/你自己的用户名/tmp</value>     </property> 

 

2. mapred-site.xml

In <configuration> </configuration>, insert

<property>     <name>mapred.job.tracker</name>     <value>localhost:9001</value></property>

 

3. format the hadoop file system before running hadoop for the first time.

Go to the file path where hadoop is installed, and enter

Bin/hadoop namenode-format

 

4. Start hadoop and enter

Bin/start-all.sh

This script is deprecated. Instead use start-dfs.sh and start-yarn.sh

 

Bash start-dfs.sh (need to configure export java_home)

Bash start-yarn.sh

 

JPS

Http: // localhost: 50070 (dfshealth)

Http: // localhost: 8088 (cluster metrics)

 

5. Run wordcount example

1). Create a file

/Home/guan/myword.txt

2) create a hadoop directory

./Bin/hadoop FS-mkdir/Input

3). upload files

./Bin/hadoop FS-put-f/home/guan/myword.txt/Input

4). Execute

./Bin/hadoop jar./share/hadoop/mapreduce/sources/hadoop-mapreduce-examples-2.4.1-sources.jarorg.apache.hadoop.examples.WordCount/Input/Output

5). view the result

./Bin/hadoop FS-CAT/output/part-r-00000

Hadoop 2.4 pseudo-distributed mode

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.