Changes between Version 1 and Version 2 of NCHCCloudCourse100802/Lab4


Ignore:
Timestamp:
Aug 6, 2010, 11:36:04 AM (14 years ago)
Author:
jazz
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • NCHCCloudCourse100802/Lab4

    v1 v2  
    22#!html
    33<div style="text-align: center;"><big
    4  style="font-weight: bold;"><big><big>實做四: Hadoop 程式編譯</big></big></big></div>
     4 style="font-weight: bold;"><big><big>實作四: MapReduce 程式編譯</big></big></big><br/><big><big>Lab4: Compiling Hadoop MapReduce Java Program</big></big></div>
    55}}}
    66[[PageOutline]]
    77
    8 = 練習 1 : Word Count 初級版 =
     8= Practice 1 : Word Count #1 (Basic) =
    99
    10  * 上傳內容到hdfs內
     10 * 上傳內容到 HDFS 內[[BR]]upload data to HDFS
    1111
    1212{{{
     
    1919}}}
    2020
    21  * 下載 [http://secuse.nchc.org.tw/class/WordCount.java WordCount.java] 並存到/opt/hadoop;
     21 * 下載 [http://secuse.nchc.org.tw/class/WordCount.java WordCount.java] 並存到/opt/hadoop;[[BR]]Download [http://secuse.nchc.org.tw/class/WordCount.java WordCount.java] and save to /opt/hadoop
    2222{{{
    23 $ wget http://secuse.nchc.org.tw/class/WordCount.java
     23~$ cd /opt/hadoop
     24/opt/hadoop$ wget http://secuse.nchc.org.tw/class/WordCount.java
    2425}}}
    2526
    26  * 運作程式
     27 * 運作程式[[BR]]Compile WordCount.java and run it by '''hadoop jar''' command
    2728
    2829{{{
     
    3435}}}
    3536
    36  * lab4_out1 執行結果
     37 * lab4_out1 執行結果 [[BR]]You should see results like this :
    3738{{{
    3839#!text
     
    5253-----
    5354
    54 = 練習 2 : Word Count 進階版 =
     55= Practice 2 : Word Count #2 (Advanced) =
    5556
    5657{{{
     
    6162
    6263
    63  * 下載 [raw-attachment:wiki:Hadoop_Lab4:WordCount2.java WordCount2.java] 並存到/opt/hadoop;
     64 * 下載 [raw-attachment:wiki:Hadoop_Lab4:WordCount2.java WordCount2.java] 並存到/opt/hadoop;[[BR]]Download [raw-attachment:wiki:Hadoop_Lab4:WordCount2.java WordCount2.java] to /opt/hadoop
    6465{{{
    65 $ wget http://trac.nchc.org.tw/cloud/raw-attachment/wiki/Hadoop_Lab4/WordCount2.java
     66~$ cd /opt/hadoop
     67/opt/hadoop$ wget http://trac.nchc.org.tw/cloud/raw-attachment/wiki/Hadoop_Lab4/WordCount2.java
    6668}}}
    6769
     
    7375}}}
    7476
    75  * lab4_out2 執行結果
     77 * lab4_out2 執行結果[[BR]]You should see results like this:
    7678{{{
    7779#!text
     
    8991}}}
    9092
     93 * Let's given case insensitive and ignore pattern for this example
    9194{{{
    92 $ bin/hadoop jar wordcount2.jar WordCount2 -Dwordcount.case.sensitive=false lab4_input lab4_out3 -skip pattern.txt
    93 $ bin/hadoop fs -cat lab4_out3/part-00000
     95/opt/hadoop$ echo "\," > pattern.txt && echo "\." >> pattern.txt
     96/opt/hadoop$ bin/hadoop jar wordcount2.jar WordCount2 -Dwordcount.case.sensitive=false lab4_input lab4_out3 -skip pattern.txt
     97/opt/hadoop$ bin/hadoop fs -cat lab4_out3/part-00000
    9498}}}
    9599
    96  * lab4_out3 執行結果
     100 * lab4_out3 執行結果[[BR]]You should see results like this:
    97101{{{
    98102#!text