Difference between revisions of "Hadoop: Menjalankan MapReduce Job -WordCount"

From OnnoWiki
Jump to navigation Jump to search
(New page: Sumber: http://wiki.apache.org/hadoop/WordCount hadoop jar hadoop-*-examples.jar wordcount [-m <#maps>] [-r <#reducers>] <in-dir> <out-dir> hadoop dfs -copyFromLocal <local-dir> <hdf...)
 
Line 1: Line 1:
 
Sumber: http://wiki.apache.org/hadoop/WordCount
 
Sumber: http://wiki.apache.org/hadoop/WordCount
 +
 +
==Buat File Data Sederhana==
 +
 +
cd ~
 +
touch file01
 +
touch file02
 +
echo "Hello World Bye World" > file01
 +
echo "Hello Hadoop Goodbye Hadoop" > file02
 +
 +
 +
 +
hadoop dfs -ls /usr/joe/wordcount/input/
 +
/usr/joe/wordcount/input/file01
 +
/usr/joe/wordcount/input/file02
 +
 +
hadoop dfs -cat /usr/joe/wordcount/input/file01
 +
Hello World Bye World
 +
 +
hadoop dfs -cat /usr/joe/wordcount/input/file02
 +
Hello Hadoop Goodbye Hadoop
 +
 +
  
 
  hadoop jar hadoop-*-examples.jar wordcount [-m <#maps>] [-r <#reducers>] <in-dir> <out-dir>  
 
  hadoop jar hadoop-*-examples.jar wordcount [-m <#maps>] [-r <#reducers>] <in-dir> <out-dir>  

Revision as of 17:21, 9 November 2015

Sumber: http://wiki.apache.org/hadoop/WordCount

Buat File Data Sederhana

cd ~
touch file01
touch file02
echo "Hello World Bye World" > file01
echo "Hello Hadoop Goodbye Hadoop" > file02


hadoop dfs -ls /usr/joe/wordcount/input/
/usr/joe/wordcount/input/file01
/usr/joe/wordcount/input/file02
hadoop dfs -cat /usr/joe/wordcount/input/file01
Hello World Bye World
hadoop dfs -cat /usr/joe/wordcount/input/file02
Hello Hadoop Goodbye Hadoop 


hadoop jar hadoop-*-examples.jar wordcount [-m <#maps>] [-r <#reducers>] <in-dir> <out-dir> 


hadoop dfs -copyFromLocal <local-dir> <hdfs-dir> 


Referensi