Changes between Version 3 and Version 4 of waue/2009/0822
- Timestamp:
- Aug 19, 2009, 12:18:00 PM (16 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
waue/2009/0822
v3 v4 41 41 1 將javadoc (jdk-6u10-docs.zip) 下載下來 42 42 [https://cds.sun.com/is-bin/INTERSHOP.enfinity/WFS/CDS-CDS_Developer-Site/en_US/-/USD/ViewProductDetail-Start?ProductRef=jdk-6u10-docs-oth-JPR@CDS-CDS_Developer 下載點] 43 [[Image(wiki:waue :2009:0617:1-1.png)]]43 [[Image(wiki:waue/2009/0617:1-1.png)]] 44 44 45 45 2 下載完後將檔案放在 /tmp/ 下 … … 112 112 113 113 一開始會出現問你要將工作目錄放在哪裡:在這我們用預設值 114 [[Image(wiki:waue :2009:0617:2-1.png)]]114 [[Image(wiki:waue/2009/0617:2-1.png)]] 115 115 ------- 116 116 … … 123 123 || window -> || open pers.. -> || other.. -> || map/reduce|| 124 124 125 [[Image(wiki:waue :2009:0617:win-open-other.png)]]125 [[Image(wiki:waue/2009/0617:win-open-other.png)]] 126 126 127 127 ------- 128 128 129 129 設定要用 Map/Reduce 的視野 130 [[Image(wiki:waue :2009:0617:2-2.png)]]130 [[Image(wiki:waue/2009/0617:2-2.png)]] 131 131 132 132 --------- 133 133 134 134 使用 Map/Reduce 的視野後的介面呈現 135 [[Image(wiki:waue :2009:0617:2-3.png)]]135 [[Image(wiki:waue/2009/0617:2-3.png)]] 136 136 137 137 -------- … … 140 140 141 141 || file -> || new -> || project -> || Map/Reduce -> || Map/Reduce Project -> || next || 142 [[Image(wiki:waue :2009:0617:file-new-project.png)]]142 [[Image(wiki:waue/2009/0617:file-new-project.png)]] 143 143 144 144 -------- … … 146 146 建立mapreduce專案(1) 147 147 148 [[Image(wiki:waue :2009:0617:2-4.png)]]148 [[Image(wiki:waue/2009/0617:2-4.png)]] 149 149 150 150 ----------- … … 158 158 }}} 159 159 160 [[Image(wiki:waue :2009:0617:2-4-2.png)]]160 [[Image(wiki:waue/2009/0617:2-4-2.png)]] 161 161 162 162 … … 171 171 Step1. 右鍵點選project的properties做細部設定 172 172 173 [[Image(wiki:waue :2009:0617:2-5.png)]]173 [[Image(wiki:waue/2009/0617:2-5.png)]] 174 174 175 175 ---------- … … 178 178 179 179 hadoop的javadoc的設定(1) 180 [[Image(wiki:waue :2009:0617:2-5-1.png)]]180 [[Image(wiki:waue/2009/0617:2-5-1.png)]] 181 181 182 182 * java Build Path -> Libraries -> hadoop0.18.3-ant.jar … … 193 193 ------------ 194 194 Step3. hadoop的javadoc的設定完後(2) 195 [[Image(wiki:waue :2009:0617:2-5-2.png)]]195 [[Image(wiki:waue/2009/0617:2-5-2.png)]] 196 196 197 197 ------------ … … 200 200 * javadoc location -> 輸入:file:/usr/lib/jvm/java-6-sun/docs/api/ 201 201 202 [[Image(wiki:waue :2009:0617:2-5-3.png)]]202 [[Image(wiki:waue/2009/0617:2-5-3.png)]] 203 203 204 204 ----- … … 210 210 -------- 211 211 Step1. 視窗右下角黃色大象圖示"Map/Reduce Locations tag" -> 點選齒輪右邊的藍色大象圖示: 212 [[Image(wiki:waue :2009:0617:2-6.png)]]212 [[Image(wiki:waue/2009/0617:2-6.png)]] 213 213 214 214 ------------- 215 215 Step2. 進行eclipse 與 hadoop 間的設定(2) 216 [[Image(wiki:waue :2009:0617:2-6-1.png)]]216 [[Image(wiki:waue/2009/0617:2-6-1.png)]] 217 217 218 218 {{{ … … 227 227 228 228 設定完後,可以看到下方多了一隻藍色大象,左方展開資料夾也可以秀出在hdfs內的檔案結構 229 [[Image(wiki:waue :2009:0617:2-6-2.png)]]229 [[Image(wiki:waue/2009/0617:2-6-2.png)]] 230 230 ------------- 231 231 … … 245 245 246 246 || File -> || new -> || mapper || 247 [[Image(wiki:waue :2009:0617:file-new-mapper.png)]]247 [[Image(wiki:waue/2009/0617:file-new-mapper.png)]] 248 248 249 249 ----------- … … 251 251 2. create 252 252 253 [[Image(wiki:waue :2009:0617:3-1.png)]]253 [[Image(wiki:waue/2009/0617:3-1.png)]] 254 254 {{{ 255 255 #!sh … … 290 290 291 291 建立mapper.java後,貼入程式碼 292 [[Image(wiki:waue :2009:0617:3-2.png)]]292 [[Image(wiki:waue/2009/0617:3-2.png)]] 293 293 294 294 ------------ … … 299 299 300 300 * File -> new -> reducer 301 [[Image(wiki:waue :2009:0617:file-new-reducer.png)]]301 [[Image(wiki:waue/2009/0617:file-new-reducer.png)]] 302 302 303 303 ------- 304 304 2. create 305 [[Image(wiki:waue :2009:0617:3-3.png)]]305 [[Image(wiki:waue/2009/0617:3-3.png)]] 306 306 307 307 {{{ … … 342 342 343 343 * File -> new -> Map/Reduce Driver 344 [[Image(wiki:waue :2009:0617:file-new-mr-driver.png)]]344 [[Image(wiki:waue/2009/0617:file-new-mr-driver.png)]] 345 345 ---------- 346 346 … … 350 350 351 351 建立WordCount.java,此檔用來驅動mapper 與 reducer,因此選擇 Map/Reduce Driver 352 [[Image(wiki:waue :2009:0617:3-4.png)]]352 [[Image(wiki:waue/2009/0617:3-4.png)]] 353 353 ------------ 354 354 … … 404 404 405 405 三個檔完成後並存檔後,整個程式建立完成 406 [[Image(wiki:waue :2009:0617:3-5.png)]]406 [[Image(wiki:waue/2009/0617:3-5.png)]] 407 407 408 408 ------- … … 425 425 * 右鍵點選WordCount.java -> run as -> run on Hadoop 426 426 427 [[Image(wiki:waue :2009:0617:run-on-hadoop.png)]]427 [[Image(wiki:waue/2009/0617:run-on-hadoop.png)]] 428 428 429 429 … … 432 432 * eclipse 可以產生出jar檔 : 433 433 434 File -> Export -> java -> JAR file 434 File -> Export -> java -> JAR file [[br]] 435 435 -> next -> 436 436 -------- 437 437 選擇要匯出的專案 -> 438 jarfile: /home/hadooper/mytest.jar -> 438 jarfile: /home/hadooper/mytest.jar -> [[br]] 439 439 next -> 440 440 -------- 441 441 next -> 442 442 -------- 443 main class: 選擇有Main的class -> 443 main class: 選擇有Main的class -> [[br]] 444 444 Finish 445 445 -------- … … 530 530 * 而回到eclipse視窗,我們可以看到下方視窗run完的job會呈現出來;左方視窗也多出output資料夾,part-r-00000就是我們的結果檔 531 531 532 [[Image(wiki:waue :2009:0617:4-1.png)]]532 [[Image(wiki:waue/2009/0617:4-1.png)]] 533 533 ------ 534 534 * 因為有設定完整的javadoc, 因此可以得到詳細的解說與輔助 535 [[Image(wiki:waue :2009:0617:4-2.png)]]535 [[Image(wiki:waue/2009/0617:4-2.png)]] 536 536 537 537 === make output ===