运行hadoop自带示例程序wordcount

创建 a.txt

[[email protected] ~]$ vim a.txt 

spark   hadoop  spark
hadoop  yarn    resouremanager
yarn
hadoop

创建 b.txt

[[email protected] ~]$ vim b.txt 

1001    aaa
1002    bbb
hadoop
hadoop1

创建 wordcount/input hdfs的目录

hadoop fs -mkdir -p  /wordcount1/input1

将 a.txt 和 b.txt 上传到  hdfs 的 wordcount/input

hadoop fs -put a.txt /wordcount/input

hadoop fs -put b.txt /wordcount/input

运行自带wordcount程序

hadoop jar hadoop-mapreduce-examples-2.7.7.jar wordcount /wordcount/input /output

查看运行结果

hadoop fs -cat /output/part-r-00000

运行hadoop自带示例程序wordcount

相关文章:

  • 2021-04-30
  • 2021-07-28
  • 2021-12-18
  • 2022-02-11
  • 2021-12-16
  • 2021-11-20
  • 2021-08-21
猜你喜欢
  • 2022-12-23
  • 2021-10-04
  • 2022-12-23
  • 2021-04-09
  • 2022-12-23
  • 2022-12-23
  • 2021-09-05
相关资源
相似解决方案