hadoop2.2编程:hadoop性能测试
《hadoop the definitive way》(third version)中的Benchmarking a Hadoop Cluster Test Cases 的class在新的版本中已不再是hadoop-*-test.jar, 新版本中做BanchMark Test应采用如下方法:
1. TestDFSIO
write
TestDFSIO用来测试HDFS的I/O 性能,用一个MapReduce job来并行读取/写入文件, 每个文件在一个独立的map task里被读取或写入,而map的输出用来收集该文件被执行过程中的统计数据,
写入2个文件,每个10MB
$yarn jar share/hadoop/mapreduce/hadoop-mapreduce-client-jobclient-2.2.0-tests.jar \ TestDFSIO -write -nrFiles 2 -fileSize 10
提交job时的consol输出:
// :: INFO fs.TestDFSIO: TestDFSIO.1.7 // :: INFO fs.TestDFSIO: nrFiles = // :: INFO fs.TestDFSIO: nrBytes (MB) = 10.0 // :: INFO fs.TestDFSIO: bufferSize = // :: INFO fs.TestDFSIO: baseDir = /benchmarks/TestDFSIO // :: INFO fs.TestDFSIO: creating control bytes, files // :: INFO fs.TestDFSIO: created control files files // :: INFO client.RMProxy: Connecting to ResourceManager at cluster1/ // :: INFO client.RMProxy: Connecting to ResourceManager at cluster1/ // :: INFO mapred.FileInputFormat: Total input paths to process : // :: INFO mapreduce.JobSubmitter: number of splits: // :: INFO mapreduce.JobSubmitter: Submitting tokens for job: job_1384321503481_0003 // :: INFO impl.YarnClientImpl: Submitted application application_1384321503481_0003 to ResourceManager at cluster1/ // :: INFO mapreduce.Job: The url to track the job: http://cluster1:8888/proxy/application_1384321503481_0003/ // :: INFO mapreduce.Job: Running job: job_1384321503481_0003
从consol输出可以看到:
(1)最终文件默认会被写入hdfs里的/benchmarks/TestDFSIO文件夹下, benchmarks文件夹默认位于hdfs里当前用户下面,此处位于/user/grid/下面,通过test.build.data的系统变量可以修改默认设置。
(2)2个map task (number of splits:2), 同时也证明每一个文件的写入或读取都被单独作为一个map task
job跑完后的console输出:
// :: INFO mapreduce.Job: map % reduce % // :: INFO mapreduce.Job: Job job_1384321503481_0003 completed successfully // :: INFO mapreduce.Job: Counters: File System Counters FILE: Number of bytes read= FILE: Number of bytes written= FILE: Number of read operations= FILE: Number of large read operations= FILE: Number of HDFS: Number of bytes read= HDFS: Number of bytes written= HDFS: Number of read operations= HDFS: Number of large read operations= HDFS: Number of Job Counters Launched map tasks= Launched reduce tasks= Data-local map tasks= Total Total Map-Reduce Framework Map input records= Map output records= Map output bytes= Map output materialized bytes= Input Combine input records= Combine output records= Reduce input Reduce shuffle bytes= Reduce input records= Reduce output records= Spilled Records= Shuffled Maps = Failed Shuffles= Merged Map outputs= GC CPU Physical memory (bytes) snapshot= Virtual memory (bytes) snapshot= Total committed heap usage (bytes)= Shuffle Errors BAD_ID= CONNECTION= IO_ERROR= WRONG_LENGTH= WRONG_MAP= WRONG_REDUCE= File Input Format Counters Bytes Read= File Output Format Counters Bytes Written= // :: INFO fs.TestDFSIO: ----- TestDFSIO ----- : write // :: INFO fs.TestDFSIO: Date & :: PST // :: INFO fs.TestDFSIO: Number of files: // :: INFO fs.TestDFSIO: Total MBytes processed: 20.0 // :: INFO fs.TestDFSIO: Throughput mb/sec: 0.5591277606933184 // :: INFO fs.TestDFSIO: Average IO rate mb/sec: 0.5635650753974915 // :: INFO fs.TestDFSIO: IO rate std deviation: 0.05000733272172887 // :: INFO fs.TestDFSIO: Test exec time sec: 534.566 // :: INFO fs.TestDFSIO:
从图中可以看到map task 2, reduce task 1, 统计结果中有平均I/O速率,整体速率, job运行时间,写入文件数;
read
$yarn jar \ share/hadoop/mapreduce/hadoop-mapreduce-client-jobclient--tests.jar \ TestDFSIO -read -nrFiles -fileSize
就不仔细分析了,自己试试。
2. MapReduce Test with Sort
hadoop提供了一个MapReduce 程序,可以测试整个MapReduce System。此基准测试分三步:
产生random data
sort data
validate results
步骤如下:
产生random data
$yarn jar \ share/hadoop/mapreduce/hadoop-mapreduce-examples-.jar\ randomwriter random-data
用RandomWriter产生random data, 在yarn上运行RandomWriter会启动一个MapReduce job, 每个node上默认启动10个map task, 每个map 会产生1GB的random data.
修改默认参数: test.randomwriter.maps_per_host, test.randomwrite.bytes_per_map
sort data
$yarn jar \ share/hadoop/mapreduce/hadoop-mapreduce-examples-.jar \ sort random-data sorted-data #the command 会启动一个SortValidator 程序, #此程序会做一些列检查例如检查unsorted和sorted data是否精确
3. 其他Tests
MRBench –invoked by mrbench, 此程序会启动一个程序,运行多次
NNBench – invoked by nnbench, namenode上的负载测试
Gridmix --暂时没兴趣
(完)
hadoop2.2编程:hadoop性能测试的更多相关文章
- hadoop2.2编程:自定义hadoop map/reduce输入文件切割InputFormat
hadoop会对原始输入文件进行文件切割,然后把每个split传入mapper程序中进行处理,FileInputFormat是所有以文件作为数据源的InputFormat实现的基类,FileInput ...
- hadoop2.2编程:用ruby跑hadoop的完整实例
Becareful! All nodes include need to install ruby! #!/usr/bin/ruby # Ruby code for map.rb ARGF.eac ...
- hadoop2.2编程:使用MapReduce编程实例(转)
原文链接:http://www.cnblogs.com/xia520pi/archive/2012/06/04/2534533.html 从网上搜到的一篇hadoop的编程实例,对于初学者真是帮助太大 ...
- hadoop2.2编程:各种API
hadoop2.2 API http://hadoop.apache.org/docs/r0.23.9/api/index.html junit API http://junit.org/javado ...
- hadoop2.2编程:DFS API 操作
1. Reading data from a hadoop URL 说明:想要让java从hadoop的dfs里读取数据,则java 必须能够识别hadoop hdfs URL schema, 因此我 ...
- hadoop2.2编程: 重写comparactor
要点: 类型比较在hadoop的mapreduce中非常重要,主要用来比较keys; hadoop中的RawComparator<T>接口继承自java的comparator, 主要用来比 ...
- 《Hadoop》对于高级编程Hadoop实现构建企业级安全解决方案
本章小结 ● 理解企业级应用的安全顾虑 ● 理解Hadoop尚未为企业级应用提供的安全机制 ● 考察用于构建企业级安全解决方式的方法 第10章讨论了Hadoop安全性以及Hadoop ...
- VM+CentOS+hadoop2.7搭建hadoop完全分布式集群
写在前边的话: 最近找了一个云计算开发的工作,本以为来了会直接做一些敲代码,处理数据的活,没想到师父给了我一个课题“基于质量数据的大数据分析”,那么问题来了首先要做的就是搭建这样一个平台,毫无疑问,底 ...
- Linux上安装Hadoop集群(CentOS7+hadoop-2.8.0)--------hadoop环境的搭建
Linux上安装Hadoop集群(CentOS7+hadoop-2.8.0)------https://blog.csdn.net/pucao_cug/article/details/71698903 ...
随机推荐
- python tornado+mongodb的使用
tornado tar xvzf tornado-1.2.1.tar.gz cd tornado-1.2.1 python setup.py build sudo python setup.py in ...
- JS中的replace方法以及与正则表达式的结合应用
replace方法的语法是:stringobj.replace(rgexp, replacetext) 其中stringobj是字符串(string),reexp可以是正则表达式对象(regexp)也 ...
- jsp文件怎么打开呢
jsp是一种嵌入式网页脚本,正常情况下可以用记事本等文本工具直接打开,也可用DREAMWEAVER等网页设计工具友好编辑.不过这样只能看到程序的源代码.当然,我们也可以用IE等浏览器直接打开浏览,前提 ...
- 控制器的跳转-modal与push
一.modal与pushmodal从下面往上盖住原来的控制器,一般上一个控制器和下一个控制器没有什么关联时用modal,比如联系人的加号跳转页面,任何控制器都可以用modal push一般是上下文有关 ...
- 两款web api 调试工具
两款web api 调试工具: Fiddler (http://www.telerik.com/fiddler) Postman(http://www.getpostman.com/) 资源: Fid ...
- 九度OJ 1516 调整数组顺序使奇数位于偶数前面 -- 归并排序
题目地址:http://ac.jobdu.com/problem.php?pid=1516 题目描述: 输入一个整数数组,实现一个函数来调整该数组中数字的顺序,使得所有的奇数位于数组的前半部分,所有的 ...
- 【自用代码】Json转对象
private static object JsonToObject(string jsonString, object obj) { var serializer = new DataContrac ...
- Jquery div边框大全
网址 http://jquery.malsup.com/corner/ jQuery Corner是一款jQuery的插件,最初由Dave Methvin开发,但后在Malsup同志的协助下,进行了一 ...
- Cocos2d-x课程大纲/学习路线
Cocos2d-x课程大纲/学习路线 这是什么? 这个一个Cocos2d-x技术路线的课程大纲/学习大纲. 你能用它做什么? 如果你是找工作的人, 利用本大纲, 你可以学习Cocos2d-x, 做一个 ...
- 『奇葩问题集锦』Zepto 页面唤醒拨号功能点透
不废话直接上代码: HTML: <a class="js-tel tel" data-tel="1312414"></a> JS: // ...