close
Warning:
Can't synchronize with repository "(default)" (Unsupported version control system "svn": /usr/lib/python2.7/dist-packages/libsvn/_repos.so: failed to map segment from shared object: Cannot allocate memory). Look in the Trac log for more information.
- Timestamp:
-
Jan 18, 2014, 12:26:51 AM (11 years ago)
- Author:
-
jazz
- Comment:
-
--
Legend:
- Unmodified
- Added
- Removed
- Modified
-
v1
|
v1
|
|
| 1 | ◢ <[wiki:III140118/Lab15 實作十五]> | <[wiki:III140118 回課程大綱]> ▲ | <[wiki:III140118/Lab17 實作十七]> ◣ |
| 2 | |
| 3 | = 實作十六 Lab16 = |
| 4 | |
| 5 | {{{ |
| 6 | #!html |
| 7 | <p style="text-align: center;"><big style="font-weight: bold;"><big>從 WordCount 範例學習舊版 Hadoop MapReduce 的程式組成結構<br/>Learning Hadoop MapReduce Code Structure from WordCount Example</big></big></p> |
| 8 | }}} |
| 9 | |
| 10 | [[PageOutline]] |
| 11 | |
| 12 | {{{ |
| 13 | #!text |
| 14 | 請先連線至 nodeN.3du.me , N 為您的報名編號 |
| 15 | }}} |
| 16 | |
| 17 | == STEP 1 : 執行 MapReduce 任務 == |
| 18 | |
| 19 | * 讓我們來觀察一下,當執行 MapReduce 任務時,發生了什麼事情? |
| 20 | {{{ |
| 21 | cd ~/hadoop_labs/lab008 |
| 22 | ant |
| 23 | hadoop fs -rmr input output |
| 24 | hadoop fs -put ~/hadoop/conf input |
| 25 | hadoop jar WordCount.jar input output |
| 26 | }}} |
| 27 | |
| 28 | * 提交任務後,請觀察另一個視窗 jps 結果的變化,並且觀察 50030 頁面的變化(需自行按 F5 更新畫面)。 |
| 29 | |
| 30 | * 切換到單機模式,讓我們重新執行一次 WordCount.jar |
| 31 | {{{ |
| 32 | export HADOOP_CONF_DIR=~/hadoop/conf.local/ |
| 33 | hadoop fs -put ~/hadoop/conf local-input |
| 34 | hadoop jar WordCount.jar local-input local-output |
| 35 | unset HADOOP_CONF_DIR |
| 36 | }}} |
| 37 | |
| 38 | == 實作習題 == |
| 39 | |
| 40 | <問題 1> 請問在另一個視窗中,執行 jps 的結果,哪個 java process 代表 WordCount.java 的 main() 函數呢? |
| 41 | {{{ |
| 42 | #!text |
| 43 | (A) TaskTracker |
| 44 | (B) RunJar |
| 45 | (C) Child |
| 46 | (D) Main |
| 47 | }}} |
| 48 | |
| 49 | <問題 2> 請問在另一個視窗中,執行 jps 的結果,您觀察到最多同時存在幾個名為「Child」的 java process? |
| 50 | {{{ |
| 51 | #!text |
| 52 | (A) 0 |
| 53 | (B) 1 |
| 54 | (C) 2 |
| 55 | (D) 3 |
| 56 | }}} |