1. 创建文件夹 使用命令 hadoop fs -mkdir wordcount_input 在 HDFS 中创建一个名为 wordcount_input 的文件夹。

  2. 上传文本文件 使用命令 hadoop fs -put /home/hadoop/21.txt wordcount_input 将本地文件系统中的 21.txt 文件上传至 HDFS 的 wordcount_input 文件夹中。同样地,也将 16.txt 文件上传至该文件夹中。

  3. 查看文件夹内容 使用命令 hadoop fs -ls wordcount_input 查看 HDFS 中 wordcount_input 文件夹中的内容。

  4. 运行 wordcount 使用命令 hadoop jar /usr/local/hadoop/share/hadoop/mapreduce/hadoop-mapreduce-examples-2.9.2.jar wordcount wordcount_input output 运行 wordcount,其中 wordcount_input 为输入文件夹,output 为输出文件夹。

  5. 查看输出结果 使用命令 hadoop fs -ls output 查看输出文件夹中的内容,使用命令 hadoop fs -cat output/part-r-00000 查看结果文件中的内容

详细地给出这个实验的具体步骤5 运行wordcount使用hadoop fs -mkdir命令在HDFS中创建文件夹wordcount_input用hadoop fs -put命令将本地文件系统中的文本文件在hadoop用户下的21txt和16txt没有文件夹包含着的文本文件上传至HDFS中指定的文件夹里使用hadoop fs -ls命令显示HDFS中指定文件夹里的内容。将这两个文件上传至HDFS

原文地址: https://www.cveoy.top/t/topic/fiPH 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录