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的更多相关文章

  1. Mac OS X上搭建伪分布式CDH版本Hadoop开发环境

    最近在研究数据挖掘相关的东西,在本地 Mac 环境搭建了一套伪分布式的 hadoop 开发环境,采用CDH发行版本,省时省心. 参考来源 How-to: Install CDH on Mac OSX ...

  2. Windows下Eclipse提交MR程序到HadoopCluster

    作者:Syn良子 出处:http://www.cnblogs.com/cssdongl 欢迎转载,转载请注明出处. 以前Eclipse上写好的MapReduce项目经常是打好包上传到Hadoop测试集 ...

  3. Hadoop安装-部署-测试

    一:准备Linux环境[安装略]        a.修改主机名                vim /etc/sysconfig/network                NETWORKING= ...

  4. 关于素数:求不超过n的素数,素数的判定(Miller Rabin 测试)

    关于素数的基本介绍请参考百度百科here和维基百科here的介绍 首先介绍几条关于素数的基本定理: 定理1:如果n不是素数,则n至少有一个( 1, sqrt(n) ]范围内的的因子 定理2:如果n不是 ...

  5. Hadoop 中利用 mapreduce 读写 mysql 数据

    Hadoop 中利用 mapreduce 读写 mysql 数据   有时候我们在项目中会遇到输入结果集很大,但是输出结果很小,比如一些 pv.uv 数据,然后为了实时查询的需求,或者一些 OLAP ...

  6. 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 - ...

  7. Creating a Hadoop-2.x project in Eclipse

    Creating a Hadoop-2.x project in Eclipse hortonworks:MapReduce Ports http://docs.hortonworks.com/HDP ...

  8. 通过mapreduce把mysql的数据读取到hdfs

    前面讲过了怎么通过mapreduce把mysql的一张表的数据放到另外一张表中,这次讲的是把mysql的数据读取到hdfs里面去 具体怎么搭建环境我这里就不多说了.参考 通过mapreduce把mys ...

  9. 通过mapreduce把mysql的一张表的数据导到另外一张表中

    怎么安装hadoop集群我在这里就不多说了,我这里安装的是三节点的集群 先在主节点安装mysql 启动mysql 登录mysql 创建数据库,创建表格,先把数据加载到表格 t ,表格t2是空的 mys ...

随机推荐

  1. Debian NAT共享上网

    如果Linux主机有两个网卡,比如一个有线.一个无线,当无线连接后,其他机器即可通过有线共享上网,为了方便叙述,假设环境如下: A机器有两块网卡,eth0和ws0,其中ws0为无线网卡,已连接wifi ...

  2. linux中的热插拔和mdev机制

    mdev手册(自己翻译的留着看) mdev实现U盘或SD卡的自动挂载 mdev的使用以及mdev.conf的规则配置--busybox linux中的热插拔和mdev机制 关于实现udev/mdev自 ...

  3. apache占用内存高解决办法

    我用512M的vps,访问量不大,但内存占用很大,甚至宕机. 我用top,然后shitf+m发现,httpd占用内存极大.经过网上找资料设置后,用过一段时间终于没再出现内存问题了. 首先查找配置文件的 ...

  4. Linux 安装json神器 jq

    wget -O jq https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64 chmod +x ./jq cp jq /u ...

  5. SecureCRT 设置字体跟颜色

    SecureCRT 绝佳配色方案, 保护你的眼睛 分类: Linux 软件使用2013-05-17 08:45 24038人阅读 评论(11) 收藏 举报 SecureCRT 绝佳配色方案, 保护你的 ...

  6. /bin/sh^M:bad interpreter: No such file or directory

    bash脚本:/bin/sh^M:bad interpreter: No such file or directory   dos2unix 实际上就是把文本文件中面的^M删除 用SHELL 写了一个 ...

  7. 微信小程序之云开发一

    最近听说微信小程序发布了云开发,可以不需要购买服务器,就能开发小程序和发布小程序,对于动辄千元的服务器,极大的节约了开发成本,受不住诱惑,我就开始了小程序的云开发,目前项目已上线,亲测不收费,闲不住的 ...

  8. hihoCoder #1321 : 搜索五•数独 (Dancing Links ,精确覆盖)

    hiho一下第102周的题目. 原题地址:http://hihocoder.com/problemset/problem/1321 题意:输入一个9*9数独矩阵,0表示没填的空位,输出这个数独的答案. ...

  9. Gaby Ivanushka(快排)

    Gaby Ivanushka Once upon a time there lived a tsar that has a daughter — Beautiful Vasilisa. There w ...

  10. php输出缓冲区

    ob_start(); echo 'aaa'; $string = ob_get_contents(); file_put_contents('a.html', $string); ob_flush( ...