wiki:waue/2012/0117

Version 7 (modified by waue, 12 years ago) (diff)

--

=環境=

(windows)

  1. 安裝 apache web server 2 , java 6
  2. 安裝 hadoop4win 於 c:\hadoop4win\
  3. 下載教材壓縮檔, 解壓縮內容,放到 c:\hadoop4win\tmp\

(linux)

  1. 安裝 apache , hadoop, sun java 6
  2. 下載教材壓縮檔, 解壓縮內容,放到 /tmp/

檢查

  • 初始資料夾 (windows 省略了 c:\hadoop4win\ )
/tmp/ProductEmp/conf/store.txt 商品資訊檔
/tmp/ProductEmp/input/ 銷售紀錄資料夾
/tmp/ProductEmp/www-web/ 網站

設定初始內容

  • /tmp/ProductEmp/conf/store.txt
    01 ; 微波爐 ; 3000
    02 ; 烤箱   ; 800
    03 ; 電暖氣 ; 1000
    04 ; 收音機 ; 300
    05 ; 冷氣機 ; 30000
    
  • /tmp/ProductEmp/input/0102.txt
    jazz:   01
    jazz:   02
    jazz:   02
    jazz:   03
    jazz:   05
    jazz:   01
    lia:    02
    lia:    03
    waue:   02
    shun:   02
    len:    02
    

=中間產物=

/tmp/ProductEmp/hdfs/ hadoop 輸入資料夾
/tmp/ProductEmp/out/ hadoop 輸出資料夾
/tmp/ProductEmp/result/ 暫時結果檔
/tmp/ProductEmp/www-web/db.js 銷售額db檔

結果

  • /tmp/ProductEmp/www-web/db.js 內容約為
    var aDataSet = [
            ['01','微波爐','3000','2','6000'],
            ['02','烤箱','800','6','4800'],
            ['03','電暖氣','1000','3','3000'],
            ['04','收音機','300','0','0'],
            ['05','冷氣機','30000','1','30000']
    ];
    
    
  • 請見 http://localhost/ProductEmp/

Attachments (3)