1. 程式人生 > >hadoop 學習(四) wordcount簡單操作

hadoop 學習(四) wordcount簡單操作

在dfs上建立目錄

hdfs dfs  -mkdir -p /user/bjjh/input

將本地檔案上傳至dfs

bin/hdfs dfs  -put wcinput/wc.input /user/bjjh/input

檔案內容

lol lol
dnf
xxx xxx

使用wordcount分析檔案
bin/hadoop jar share/hadoop/mapreduce/hadoop-mapreduce-examples-2.7.7.jar wordcount /user/bjjh/input /user/bjjh/output
 

分析結果

命令  hdfs dfs -cat /user/bjjh/output/p*
dnf     1
lol     2
xxx       2
執行過程中 yarn頁面會有進度提示  執行結束後可以看見之前執行的任務資訊   yarn地址   ip:8088