hadoop之上傳資料到hdfs模式

醉遊江湖發表於2020-10-03

通過官網配置
執行一些提供的示例 PI :
[hyxy@master hadoop]$ hadoop jar /home/hyxy/soft/hadoop/share/hadoop/mapreduce/hadoop-mapreduce-examples-2.7.3.jar pi 10 5

執行一些提供的示例 詞頻統計上傳叢集:
1)本地建立aaa.txt檔案
hello
world
hello
hyxy

2)通過hadoop指令上傳到偽分模式下
[hyxy@master hadoop]$ hadoop fs -put ~/Desktop/aaa.txt /wordcount.txt

3)檢視上傳資料,對應webUI 檢視
[hyxy@master hadoop]$ hadoop fs -ls /

4)執行案例 將結果輸出到outwordcount資料夾中
[hyxy@master hadoop]$ hadoop jar /home/hyxy/soft/hadoop/share/hadoop/mapreduce/hadoop-mapreduce-examples-2.7.3.jar wordcount /wordcount.txt outwordcount

5)檢視MR執行結果
[hyxy@master hadoop]$ hadoop fs -ls -R/
[hyxy@master hadoop]$ hadoop fs -ls /outwordcount

6)檢視執行結果:
[hyxy@master hadoop]$ hadoop fs -cat /outwordcount.txt/part-r-00000
hello 2
hyxy 1
world 1

hdfsWebUI --> http://master:50070 可以去這裡檢視自己的hdfs操作結果

相關文章