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 ...
随机推荐
- 标准库 - 输入输出处理(input and output facilities) lua
标准库 - 输入输出处理(input and output facilities)责任编辑:cynthia作者:来自ITPUB论坛 2008-02-18 文本Tag: Lua [IT168 技术文档] ...
- CAN协议学习(一)协议介绍
一.简介 CAN 是 Controller Area Network 的缩写(以下称为 CAN),是 ISO 国际标准化的串行通信协议. 在当前的汽车产业中,出于对安全性.舒适性.方便性.低公害.低成 ...
- 大师养成计划之二:hibernate框架的使用------实例演示
搭建hibernate项目框架的步骤: 一.导入jar包 二.new .cfg.xml配置文件 <?xml version="1.0" encoding="U ...
- 查看文档的后几行命令:tail
假如有一个文件test.txt,内容如下: [root@lee ~]# cat test.txt 这是第1行 这是第2行 这是第3行 这是第4行 这是第5行 这是第6行 这是第7行 这是第8行 这是第 ...
- Lumen开发:lumen源码解读之初始化(5)——注册(register)与启动(boot)
版权声明:本文为博主原创文章,未经博主允许不得转载. register()是在服务容器注册服务, bootstrap/app.php /** * 注册外部服务 */ $app->register ...
- Windows系统SVN服务器搭建与使用
下载svn:https://tortoisesvn.net/downloads.zh.html下载svn服务器:https://www.visualsvn.com/server/download/(如 ...
- Linux 服务器配置JDK
1. 查看java版本 [root@plttestap5 ~]# java -versionjava version "1.8.0_121"Java(TM) SE Runtime ...
- [原创]使用vscode+es6写nodejs服务端调试配置
前端的小伙伴们在babel等的加持下,已经可以愉快的使用es6来写代码了. 然后对于服务端的nodejs就有点坑爹了,虽然原生支持了es6,但是只是部分支持,一些不支持的特性(比如module)使用了 ...
- spring web app的结构
1 入口是web.xml tomcat加载war的时候会去读该入库文件. 2 web.xml中spring mvc的配置 定义servlet到servlet-mapping之间的映射,org.spri ...
- CoreMotion 加速器陀螺仪
初始化CoreMotion #import <CoreMotion/CoreMotion.h> CMMotionManager *motionManager = [[CMMotionMan ...