Changes between Initial Version and Version 1 of waue/2010/0115-2-3


Ignore:
Timestamp:
Jan 26, 2010, 11:36:20 PM (15 years ago)
Author:
waue
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • waue/2010/0115-2-3

    v1 v1  
     1{{{
     2#!html
     3<div style="text-align: center;"><big
     4 style="font-weight: bold;"><big><big>實做四: Hadoop 程式編譯</big></big></big></div>
     5}}}
     6[[PageOutline]]
     7
     8 = 練習 1 : Word Count 初級版 =
     9
     10 * 上傳內容到hdfs內
     11
     12{{{
     13$ cd /opt/hadoop
     14$ mkdir lab4_input
     15$ echo "I like NCHC Cloud Course." > lab4_input/input1
     16$ echo "I like nchc Cloud Course, and we enjoy this course." > lab4_input/input2
     17$ bin/hadoop fs -put lab4_input lab4_input
     18$ bin/hadoop fs -ls lab4_input
     19}}}
     20
     21 * 編輯 [wiki:waue/2010/0115-WordCountV1 wordcount.java] 並存到/opt/hadoop;
     22
     23
     24 * 運作程式
     25
     26{{{
     27$ mkdir MyJava
     28$ javac -classpath hadoop-*-core.jar -d MyJava WordCount.java
     29$ jar -cvf wordcount.jar -C MyJava .
     30$ bin/hadoop jar wordcount.jar WordCount lab4_input/ lab4_out1/
     31$ bin/hadoop fs -cat lab4_out1/part-00000
     32}}}
     33
     34 * lab4_out1 執行結果
     35{{{
     36#!text
     37Cloud   2
     38Course, 1
     39Course. 1
     40I       2
     41NCHC    1
     42and     1
     43course. 1
     44enjoy   1
     45like    2
     46nchc    1
     47this    1
     48we      1
     49}}}
     50-----