在Hadoop2.2.0上运行Wordcount小程序
来源:互联网 发布:windows vista双系统 编辑:程序博客网 时间:2024/04/29 10:52
注:转载之>>>http://blog.itpub.net/21819287/viewspace-1119313/
1、如果hdfs没有启动,则在haoop主目录下启动:
2、查看状态,保证有数据节点在运行
./bin/hdfs dfsadmin -report
看到如下状态表示一切正常
Datanodes available: 1 (1 total, 0 dead)
这一步也可以用浏览器查看:http://localhost:50070
3、新建几个数据文件,如file1.txt,file2.txt,我是放到hadoop主目录下的examples目录里
examples/file1.txt 内容如下:
hello
hello
hello
hello
examples/file2.txt 内容如下:
pmpbox
pmpbox
pmpbox
I think pmpbox will help you!
4、把文件拷贝到hadoop文件系统
./bin/hadoop fs -mkdir /input
./bin/hadoop fs -put -f examples/file1.txt examples/file2.txt /input
5、运行 WordCount
./bin/hadoop jar ./share/hadoop/mapreduce/sources/hadoop-mapreduce-examples-2.3.0-sources.jar org.apache.hadoop.examples.WordCount /input /output
运行中会显示进度。
6.
查看结果命令
./bin/hadoop fs -cat /output/part-r-00000
也可把结果从hdfs拷到文件系统中保存
./bin/hadoop fs -cat /output/part-r-00000
下面就是WordCount程序执行结果:
I
hello
help
ok
online
pmpbox
think
v1.0
will
www.92pm.com
www.isosee.com
www.pmi.org.cn
www.pmpway.com
you!
- 在Hadoop2.2.0上运行Wordcount小程序
- hadoop2.7运行wordcount程序
- Hadoop2.6.4运行Wordcount程序
- 在ubuntu12.04+hadoop2.3.0集群上运行WordCount出错
- Spark在Yarn上运行Wordcount程序
- hadoop2.2.0配置eclipse运行wordcount程序问题及解决方法
- fedora17中hadoop2.2.0在eclipse下运行wordcount
- 自己写wordcount程序在hadoop上运行
- 简单的在Hadoop2.6.0上安装eclipse运行WORDCOUNT的总结笔记
- 在伪分布式环境下通过宿主机上的eclipse运行WordCount小程序出现的问题小结
- Hadoop2.5.1 运行wordcount
- Hadoop2.7.1运行wordcount
- Hadoop2.2.0 实例测试 WordCount程序
- 配置Hadoop2.x的HDFS、MapReduce来运行WordCount程序
- 编写简单的Mapreduce程序并部署在Hadoop2.2.0上运行
- 编写简单的Mapreduce程序并部署在Hadoop2.2.0上运行
- hadoop集群运行小程序wordCount记录
- spark集群上运行helloworld程序--WordCount
- python 自己写爬虫 ---- 总结需要的包
- LNMP环境搭建
- 织梦dedecms系统首页调用内容分类信息模型联动类别的方法
- Jfreechart 1.0.9 jar包有一个bug
- AOL/J JDBC连接在EBS中的实现
- 在Hadoop2.2.0上运行Wordcount小程序
- Struts 上传下载
- MongoDB和MySQL性能测试及其结果分析2010
- Class类
- 源码分析 selector 显示
- 司徒正美文章列表
- C#OOP 之 this 和 base
- centos 安装 boost
- swift学习02-学习前言