Eclipse運行wordcount步驟

來源:互聯網
上載者:User

標籤:style   blog   http   color   os   ar   檔案   資料   2014   

Eclipse運行wordcount步驟

 

 

第一步:建立工程,匯入代碼。


第二步:建立檔案寫入資料(以空格分開),並上傳到hdfs上。

1、建立檔案並寫入資料:


2、上傳hdfs

在hadoop許可權下就行:

命令: hadoop  fs  -put  建立的檔案路徑          input目錄

 如:  hadoop  fs -put /home/hadoop/input/text03  input


查看hdfs 所有檔案

命令:hadoop fs  -ls  input

 

 

上傳成功後,在eclipse工程空間可以看到:


一般在hadoop 許可權下操作會在hadoop檔案夾裡,在root 許可權下操作會在root 檔案夾裡。

3、設定eclipse 輸入輸出路徑,

輸入路徑就是剛才上傳到hdfs的路徑,輸出路徑直接設定就可以。

 

3.1、右鍵工程:


3.2 輸入路徑:輸入路徑與輸出路徑之間用空格隔開。

注意:如果這樣寫 找不到input 路徑    在前面加上    hdfs://localhost:9000       

  hdfs://localhost:9000/user/hadoop/input/text03   hdfs://localhost:9000/user/hadoop/output/text03b

3.3 運行代碼

  點擊run,在Console中出現如下:

第N 次運行

 



 

第一次運行:



 

3.4 統計結果

 

 

 

至此運行結束。

Eclipse運行wordcount步驟

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.