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 ...
随机推荐
- Ubuntu16.04下搜狗输入法、Sublime Text 3的安装
Ubuntu16.04下搜狗输入法.Sublime Text 3的安装 一.搜狗输入法 1. 安装中文语言 默认在Ubuntu16.04下是没有中文的,需要安装中文,在System Settings- ...
- android学习笔记(3)Button控件的学习
一,增加一个button并用外部类绑定事件 //XML文件: <Button android:id="@+id/button1" android:layout_width=& ...
- ubuntu环境 rake aborted!
错误: rake aborted! Gem::LoadError: You have already activated rake 10.3.2, but your Gemfile requires ...
- explicit 和 implicit 的用法
explicit 和 implicit 属于转换运算符,如用这两者可以让我们自定义的类型支持相互交换 explicti 表示显式转换,如从 A -> B 必须进行强制类型转换(B = (B)A) ...
- subject相关信息
记录一下我的错误信息 在ssm+shiro整合的时候,发现这样一个问题,第一次登录进去之后,然后再登录,输入错误的用户名和密码,竟然仍然登录成功,突然想起来了,是不是login之后,logout之后这 ...
- 集合第七发练习之利用ArrayList做栈、队列
栈:后进先出. 队列:先进先出. 利用这个核心思想,结合集合的add和remove方法做的栈和队列如下代码所示: 主类(t1()和t2()分别演栈和队列): package cn.hncu.myS ...
- web 开发之js---js 实现自动添加input text 编辑框
<html><head><script type="text/javascript">function addNewLine(){var for ...
- drupal7 使用(hook_preprocess_HOOK)向各个主题模版里面传递变量
函数地址:hook_preprocess_HOOK 1 首先解释下hook_preprocess_HOOK这个钩子的含义: hook _ preprocess _ H ...
- phpcms的基础知识和配置
一.设置界面 1.站点设置:相当于服务器上的站点 (1)站点修改:“关键词”和“描述”的修改,便于网络优化和搜索引擎对本网站的搜索. (2)点击站点后边的修改,模板的修改,引用自己模板 2.基本设置: ...
- spider_action
spider from mobile to mobile to mobile from selenium import webdriver from selenium.webdriver.chrome ...