Changes between Initial Version and Version 1 of YZU130807/Lab12


Ignore:
Timestamp:
Aug 12, 2013, 12:16:37 PM (11 years ago)
Author:
jazz
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • YZU130807/Lab12

    v1 v1  
     1[[PageOutline]]
     2
     3◢ <[wiki:YZU130807/Lab11 實作十一]> | <[wiki:YZU130807 回課程大綱]> ▲ | <[wiki:YZU130807/Lab13 實作十三]> ◣
     4
     5= 實作十二 Lab 12 =
     6
     7{{{
     8#!html
     9<div style="text-align: center;"><big style="font-weight: bold;"><big>Hadoop Streaming 搭配不同程式語言練習<br/>Hadoop Streaming in different Language</big></big></div>
     10}}}
     11
     12{{{
     13#!text
     14以下練習,請連線至 hadoop.nchc.org.tw 操作。底下的 hXXXX 等於您的用戶名稱。
     15}}}
     16
     17== 搭配現存二進位執行檔 ==
     18== Existing Binary ==
     19
     20{{{
     21~$ hadoop fs -put /etc/hadoop/conf lab9_input
     22~$ hadoop jar hadoop-streaming.jar -input lab9_input -output lab9_out1 -mapper /bin/cat -reducer /usr/bin/wc
     23~$ hadoop fs -cat lab9_out1/part-00000
     24}}}
     25
     26== 搭配 Bash Shell Script ==
     27
     28{{{
     29~$ echo "sed -e \"s/ /\n/g\" | grep ." > streamingMapper.sh
     30~$ echo "uniq -c | awk '{print \$2 \"\t\" \$1}'" > streamingReducer.sh
     31~$ chmod a+x streamingMapper.sh
     32~$ chmod a+x streamingReducer.sh
     33~$ hadoop jar hadoop-streaming.jar -input lab9_input -output lab9_out2 -mapper streamingMapper.sh -reducer streamingReducer.sh -file streamingMapper.sh -file streamingReducer.sh
     34~$ hadoop fs -cat lab9_out2/part-00000
     35}}}