四. hadoop官網實例程序運行

官網地址: https://hadoop.apache.org

地址:https://hadoop.apache.org/docs/r2.7.2/hadoop-project-dist/hadoop-common/SingleCluster.html

官網實例grep:篩選input目錄下文件中符合正則表達式規則的子串個數:

  1. cd /opt/module/hadoop-2.7.2
  2. mkdir input
  3. cp etc/hadoop/*.xml input/
  4.  hadoop jar share/hadoop/mapreduce/hadoop-mapreduce-examples-2.7.2.jar grep input output 'dfs[a-z.]+'

注意:此處output是結果輸出路徑,這個路徑不能已存在,否則會報異常

 

執行結果:

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章