hadoop run comes wordcount program

First check hadoop process.

jps

 

 

 

Note Only one process, hadoop not start

Start hadoop process

start-dfs.sh

 

start-yarn.sh

Process description appears as follows hadoop start successfully

 

Create a directory in the following data.txt file

 

 

Inside casually enter some English characters. As I entered the same

Enter hadoop directory

 

 

Create a / data / input folder structure in the cloud

bin/hdfs dfs -mkdir -p /data/input

Data.txt upload files to the cloud,

bin/hdfs dfs -put data.txt /data/input

View cloud / data / input folder below which files

bin/hdfs dfs -ls /data/input

 

 

This is what we upload data.txt file

 

Run share / hadoop / mapreduce / hadoop-mapreduce-examples-2.7.7.jar this java program, call the method wordcount

bin/hadoop jar share/hadoop/mapreduce/hadoop-mapreduce-examples-2.7.3.jar wordcount /data/input/data.txt /data/out/data

Behind the emergence of these shows a success

 

View Results

bin/hdfs dfs -cat /data/out/data/part-r-00000

 

 

success

 

Guess you like

Origin www.cnblogs.com/InterfaceAOP/p/11546242.html