Changes between Initial Version and Version 1 of III121201/Lab9


Ignore:
Timestamp:
Dec 1, 2012, 11:16:03 AM (11 years ago)
Author:
jazz
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • III121201/Lab9

    v1 v1  
     1[[PageOutline]]
     2
     3◢ <[wiki:III121201/Lab8 實作八]> | <[wiki:III121201 回課程大綱]> ▲ | <[wiki:III121201/Lab10 實作十]> ◣
     4
     5= 實作九 Lab 9 =
     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.classcloud.org 操作。底下的 hXXXX 等於您的用戶名稱。
     15}}}
     16 * 或者連線至 https://hadoop.classcloud.org 改用 web shell 執行
     17
     18== 搭配現存二進位執行檔 ==
     19== Existing Binary ==
     20
     21{{{
     22~$ hadoop fs -put /etc/hadoop/conf lab9_input
     23~$ hadoop jar hadoop-streaming.jar -input lab9_input -output lab9_out1 -mapper /bin/cat -reducer /usr/bin/wc
     24~$ hadoop fs -cat lab9_out1/part-00000
     25}}}
     26
     27== 搭配 Bash Shell Script ==
     28
     29{{{
     30~$ echo "sed -e \"s/ /\n/g\" | grep ." > streamingMapper.sh
     31~$ echo "uniq -c | awk '{print \$2 \"\t\" \$1}'" > streamingReducer.sh
     32~$ chmod a+x streamingMapper.sh
     33~$ chmod a+x streamingReducer.sh
     34~$ hadoop jar hadoop-streaming.jar -input lab9_input -output lab9_out2 -mapper streamingMapper.sh -reducer streamingReducer.sh -file streamingMapper.sh -file streamingReducer.sh
     35~$ hadoop fs -cat lab9_out2/part-00000
     36}}}