CDH- 测试mr
cdh的mr样例算法的jar包在
[zc.lee@ip---- hadoop-0.20-mapreduce]$ pwd
/opt/cloudera/parcels/CDH-5.10.-.cdh5.10.0.p0./lib/hadoop-0.20-mapreduce
查看该目录下的文件
[zc.lee@ip---- hadoop-0.20-mapreduce]$ ll
total
drwxr-xr-x root root Jan bin
-rw-r--r-- root root Jan CHANGES.txt
drwxr-xr-x root root Jan cloudera
lrwxrwxrwx root root Jul conf -> /etc/hadoop/conf
drwxr-xr-x root root Jan contrib
drwxr-xr-x root root Jan example-confs
lrwxrwxrwx root root Jul hadoop-ant-2.6.-mr1-cdh5.10.0.jar -> ../../jars/hadoop-ant-2.6.-mr1-cdh5.10.0.jar
lrwxrwxrwx root root Jul hadoop-ant-mr1.jar -> hadoop-ant-2.6.-mr1-cdh5.10.0.jar
lrwxrwxrwx root root Jul hadoop-core-2.6.-mr1-cdh5.10.0.jar -> ../../jars/hadoop-core-2.6.-mr1-cdh5.10.0.jar
lrwxrwxrwx root root Jul hadoop-core-mr1.jar -> hadoop-core-2.6.-mr1-cdh5.10.0.jar
lrwxrwxrwx root root Jul hadoop-examples-2.6.-mr1-cdh5.10.0.jar -> ../../jars/hadoop-examples-2.6.-mr1-cdh5.10.0.jar
lrwxrwxrwx root root Jul hadoop-examples.jar -> hadoop-examples-mr1.jar
lrwxrwxrwx root root Jul hadoop-examples-mr1.jar -> hadoop-examples-2.6.-mr1-cdh5.10.0.jar
lrwxrwxrwx root root Jul hadoop-test-2.6.-mr1-cdh5.10.0.jar -> ../../jars/hadoop-test-2.6.-mr1-cdh5.10.0.jar
lrwxrwxrwx root root Jul hadoop-test-mr1.jar -> hadoop-test-2.6.-mr1-cdh5.10.0.jar
lrwxrwxrwx root root Jul hadoop-tools-2.6.-mr1-cdh5.10.0.jar -> ../../jars/hadoop-tools-2.6.-mr1-cdh5.10.0.jar
lrwxrwxrwx root root Jul hadoop-tools-mr1.jar -> hadoop-tools-2.6.-mr1-cdh5.10.0.jar
drwxr-xr-x root root Jan include
drwxr-xr-x root root Jan lib
-rw-r--r-- root root Jan LICENSE.txt
-rw-r--r-- root root Jan NOTICE.txt
-rw-r--r-- root root Jan README.txt
drwxr-xr-x root root Jan sbin
drwxr-xr-x root root Jan webapps
可以用hadoop-examples.jar里面的wordcount做测试
#hadoop jar hadoop-examples.jar
可以看到里面都有些上面可以使用的类
An example program must be given as the first argument.
Valid program names are:
aggregatewordcount: An Aggregate based map/reduce program that counts the words in the input files.
aggregatewordhist: An Aggregate based map/reduce program that computes the histogram of the words in the input files.
bbp: A map/reduce program that uses Bailey-Borwein-Plouffe to compute exact digits of Pi.
dbcount: An example job that count the pageview counts from a database.
distbbp: A map/reduce program that uses a BBP-type formula to compute exact bits of Pi.
grep: A map/reduce program that counts the matches of a regex in the input.
join: A job that effects a join over sorted, equally partitioned datasets
multifilewc: A job that counts words from several files.
pentomino: A map/reduce tile laying program to find solutions to pentomino problems.
pi: A map/reduce program that estimates Pi using a quasi-Monte Carlo method.
randomtextwriter: A map/reduce program that writes 10GB of random textual data per node.
randomwriter: A map/reduce program that writes 10GB of random data per node.
secondarysort: An example defining a secondary sort to the reduce.
sort: A map/reduce program that sorts the data written by the random writer.
sudoku: A sudoku solver.
teragen: Generate data for the terasort
terasort: Run the terasort
teravalidate: Checking results of terasort
wordcount: A map/reduce program that counts the words in the input files.
wordmean: A map/reduce program that counts the average length of the words in the input files.
wordmedian: A map/reduce program that counts the median length of the words in the input files.
wordstandarddeviation: A map/reduce program that counts the standard deviation of the length of the words in the input files.
这里我直接取wordcount类来做测试,首先上传文件到hdfs准备好计算
hdfs dfs -mkdir /user/zc.lee/input/
hdfs dfs -put /user/PG/conf/type.txt /user/zc.lee/input/
开始计算
hadoop jar hadoop-examples.jar wordcount /user/zc.lee/input/type.txt /user/zc.lee/ouputtest
检查结果
hdfs dfs -text /user/zc.lee/ouputtest/*
CDH- 测试mr的更多相关文章
- Mac OS X上搭建伪分布式CDH版本Hadoop开发环境
最近在研究数据挖掘相关的东西,在本地 Mac 环境搭建了一套伪分布式的 hadoop 开发环境,采用CDH发行版本,省时省心. 参考来源 How-to: Install CDH on Mac OSX ...
- Windows下Eclipse提交MR程序到HadoopCluster
作者:Syn良子 出处:http://www.cnblogs.com/cssdongl 欢迎转载,转载请注明出处. 以前Eclipse上写好的MapReduce项目经常是打好包上传到Hadoop测试集 ...
- Hadoop安装-部署-测试
一:准备Linux环境[安装略] a.修改主机名 vim /etc/sysconfig/network NETWORKING= ...
- 关于素数:求不超过n的素数,素数的判定(Miller Rabin 测试)
关于素数的基本介绍请参考百度百科here和维基百科here的介绍 首先介绍几条关于素数的基本定理: 定理1:如果n不是素数,则n至少有一个( 1, sqrt(n) ]范围内的的因子 定理2:如果n不是 ...
- Hadoop 中利用 mapreduce 读写 mysql 数据
Hadoop 中利用 mapreduce 读写 mysql 数据 有时候我们在项目中会遇到输入结果集很大,但是输出结果很小,比如一些 pv.uv 数据,然后为了实时查询的需求,或者一些 OLAP ...
- Hadoop-2.2.0 (传 hadoop-2.2.0.tar.gz)
配置hadoop 2.1 上传hadoop包 2.2 解压hadoop包 首先在根目录下创建一个cloud目录 mkdir /cloud tar -zxvf hadoop-2.2.0.tar.gz - ...
- Creating a Hadoop-2.x project in Eclipse
Creating a Hadoop-2.x project in Eclipse hortonworks:MapReduce Ports http://docs.hortonworks.com/HDP ...
- 通过mapreduce把mysql的数据读取到hdfs
前面讲过了怎么通过mapreduce把mysql的一张表的数据放到另外一张表中,这次讲的是把mysql的数据读取到hdfs里面去 具体怎么搭建环境我这里就不多说了.参考 通过mapreduce把mys ...
- 通过mapreduce把mysql的一张表的数据导到另外一张表中
怎么安装hadoop集群我在这里就不多说了,我这里安装的是三节点的集群 先在主节点安装mysql 启动mysql 登录mysql 创建数据库,创建表格,先把数据加载到表格 t ,表格t2是空的 mys ...
随机推荐
- executable null\bin\winutils.exe in the Hadoop binaries.
在windows 使用eclipse远程调用hadoop集群时抛出下面异常 executable null\bin\winutils.exe in the Hadoop binaries. 这个问题 ...
- 从分类,排序,top-k多个方面对推荐算法稳定性的评价
介绍 论文名: "classification, ranking, and top-k stability of recommendation algorithms". 本文讲述比 ...
- tftp服务配置
tft概念: TFTP(Trivial File Transfer Protocol,简单文件传输协议)是TCP/IP协议族中的用来在客户机与服务器之间进行简单文件传输的协议,提供不复杂.开销不大的文 ...
- 最小生成树——Kruskal(克鲁斯卡尔)算法
[0]README 0.1) 本文总结于 数据结构与算法分析, 源代码均为原创, 旨在 理解 Kruskal(克鲁斯卡尔)算法 的idea 并用 源代码加以实现: 0.2)最小生成树的基础知识,参见 ...
- 国家制定人工智能(AI)发展战略的决策根据
在今年两会上,李彦宏的提案有何道理?提案的依据是什么?这个问题必须说清楚,对社会公众有个交代. 回想过去,早在上世纪九十年代,用"电子网络"模拟人脑的想法已经出现.这样的" ...
- _DataStructure_C_Impl:图的最小生成树
#include<stdio.h> #include<stdlib.h> #include<string.h> typedef char VertexType[4] ...
- html5中form表单新增属性以及改良的input标签元素的种类
在HTML5中,表单新增了一些属性,input标签也有了更多的type类型,有些实现了js才能实现的特效,但目前有些浏览器不能全部支持.下面是一些h5在表单和input标签上的一些改动. <!D ...
- EasyNVR无插件直播服务器软件使用详情功能-通道配置Excel
背景需求 使用EasyNVR的用户都有知道,由于EasyNVR是将设备与EasyNVR的通道进行绑定的,因此EasyNVR是通过手动的通道配置来进行设备接入的,这样可以做到将设备的和通道对应的接入.但 ...
- easyUI参数传递Long型时,前台解析出错的问题——SKY
果发现datagrid在显示Long类型数据时有问题.问题如下:比如一个数据ID为20121229101239002,经过转换之后的JSON数据也没有问题,但是在显示的时候就会显示为201212291 ...
- elasticsearch从入门到出门-06-剖析Elasticsearch的基础分布式架构
这个图来自中华石杉: