hadoop运行workcount_hadoop中运行wordcount

上一节我们已经在ubuntu中安装好了hadoop集群,这一篇就在搭建好的hadoop中运行一个国际惯例wordcount程序,一是可以验证我们hadoop集群是否真的搭建成功二是顺便熟悉一下hadoop程序的运行流程1.在本地 创建一个wordcount文件root@master:~# vim wordcount.txtroot@master:~# cat wordcount.txthello ...
摘要由CSDN通过智能技术生成

上一节我们已经在ubuntu中安装好了hadoop集群,这一篇就在搭建好的hadoop中运行一个国际惯例wordcount程序,

一是可以验证我们hadoop集群是否真的搭建成功

二是顺便熟悉一下hadoop程序的运行流程

477df133885cdc82e8537826351560a2.png

1.在本地 创建一个wordcount文件

root@master:~# vim wordcount.txt

root@master:~# cat wordcount.txt

hello world

hello

2.将这个文件上传到hdfs中

root@master:~# hadoop dfs -put ./wordcount.txt /firstTestDir

DEPRECATED: Use of this script to execute hdfs command is deprecated.

Instead use the hdfs command for it.

root@master:~# hadoop dfs -ls /

DEPRECATED: Use of this script to execute hdfs command is deprecated.

Instead use the hdfs command for it.

Found 2 items

drwxr-xr-x - root supergroup 0 2018-05-14 10:03 /firstTestDir

drwx------ - root supergroup 0 2018-05-14 09:42 /tmp

root@master:~# hadoop dfs -ls /firstTestDir

DEPRECATED: Use of this script to execute hdfs command is deprecated.

Instead use the hdfs command for it.

Found 2 items

-rw-r--r-- 1 root supergroup 22002 2018-05-13 21:14 /firstTestDir/a.txt

-rw-r--r-- 1 root supergroup 19 2018-05-14 10:03 /firstTestDir/wordcount.txt

3.运行wordcount

3.1 hadoop中已经为我们提供了一些example案例在/hadoop-2.6.5/share/hadoop/mapreduce下

root@mas

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值