Hadoop基准测试

利用hadoop自带基准测试工具包进行集群性能测试,测试平台为CDH5.16上hadoop2.6版本

目录 /opt/cloudera/parcels/CDH/lib/hadoop-mapreduce/

使用TestDFSIO、mrbench、nnbench、Terasort 、sort 几个使用较广的基准测试程序

 

hadoop-mapreduce-client-jobclient-tests.jar

不带参数运行,会显示示例说明

hadoop jar /opt/cloudera/parcels/CDH/lib/hadoop-mapreduce/hadoop-mapreduce-client-jobclient-tests.jar

An example program must be given as the first argument.
Valid program names are:
  DFSCIOTest: Distributed i/o benchmark of libhdfs.
  DistributedFSCheck: Distributed checkup of the file system consistency.
  JHLogAnalyzer: Job History Log analyzer.
  MRReliabilityTest: A program that tests the reliability of the MR framework by injecting faults/failures
  SliveTest: HDFS Stress Test and Live Data Verification.
  TestDFSIO: Distributed i/o benchmark.
  fail: a job that always fails
  filebench: Benchmark SequenceFile(Input|Output)Format (block,record compressed and uncompressed),            Text(Input|Output)Format (compressed and uncompressed)
  largesorter: Large-Sort tester
  loadgen: Generic map/reduce load generator
  mapredtest: A map/reduce test check.
  minicluster: Single process HDFS and MR cluster.
  mrbench: A map/reduce benchmark that can create many small jobs
  nnbench: A benchmark that stresses the namenode.
  sleep: A job that sleeps at each map and reduce task.
  testbigmapoutput: A map/reduce program that works on a very big non-splittable file and does identity map/reduce
  testfilesystem: A test for FileSystem read/write.
  testmapredsort: A map/reduce program that validates the map-reduce framework's sort.
  testsequencefile: A test for flat files of binary key value pairs.
  testsequencefileinputformat: A test for sequence file input format.
  testtextinputformat: A test for text input format.
  threadedmapbench: A map/reduce benchmark that compares the performance of maps with multiple spills over maps with 1 spill

 

1. TestDFSIO

TestDFSIO用于测试HDFS的IO性能,使用一个MapReduce作业来并发地执行读写操作,每个map任务用于读或写每个文件,map的输出用于收集与处理文件相关的统计信息,reduce用于累积统计信息,并产生summary。

查看说明:

hadoop jar \
/opt/cloudera/parcels/CDH/lib/hadoop-mapreduce/hadoop-mapreduce-client-jobclient-tests.jar \
TestDFSIO

TestDFSIO.1.7
Usage: TestDFSIO [genericOptions] -read [-random | -backward | -skip [-skipSize Size]] | -write | -append | -clean [-compression codecClassName] [-nrFiles N] [-size Size[B|KB|MB|GB|TB]] [-resFile resultFileName] [-bufferSize Bytes]

在OpenStack云平台上部署Hadoop大数据平台之后,可以通过运行Hadoop内置的基准测试工具来评估性能,其中TestDFSIO用于测试HDFS的I/O性能,TeraSort用于评估MapReduce作业的排序性能,PI用于测试计算性能。具体的步骤如下: 参考资源链接:[OpenStack与Hadoop构建的大数据分析实践](https://wenku.youkuaiyun.com/doc/54m0njv8id?spm=1055.2569.3001.10343) 1. 测试HDFS的I/O性能(TestDFSIO): - 首先,确保Hadoop环境配置正确并且HDFS处于运行状态。 - 使用TestDFSIO工具运行读取和写入测试。例如,运行TestDFSIO的写入测试命令: `hadoop jar /path/to/hadoop-examples.jar TestDFSIO -write -nrFiles 10 -fileSize 100m` - 同样的方式,运行读取测试命令来评估读取性能。 - 分析输出结果,关注吞吐量(MB/s)和运行时间,以此来评估I/O性能。 2. 测试MapReduce的排序性能(TeraSort): - 同样保证Hadoop环境正常运行,以及HDFS可用。 - 使用TeraSort工具对指定大小的数据集进行排序。示例命令如下: `hadoop jar /path/to/hadoop-examples.jar teragen *** /teragen_output` `hadoop jar /path/to/hadoop-examples.jar terasort /teragen_output /terasort_output` - 分析排序结果的生成时间,这个时间能够反映MapReduce作业的处理速度。 3. 测试计算性能(PI): - 使用Hadoop的PI工具来评估计算性能。运行命令如下: `hadoop jar /path/to/hadoop-examples.jar pi 10 100` - 此命令将计算圆周率π的近似值,输出的是 π 的近似值和标准差,这个过程涉及大量计算。 - 通过计算时间和输出结果的准确性来评估计算性能。 在执行这些基准测试之后,可以根据测试结果评估OpenStack与Hadoop平台的性能。如果发现性能瓶颈,可以考虑优化存储设备(如使用SSD),调整Hadoop配置或优化网络设置等措施。对于希望更深入理解Hadoop性能调优的用户,可以参考《OpenStack与Hadoop构建的大数据分析实践》一书,该资源提供了实用的部署和性能优化建议,帮助用户更高效地管理和优化大数据平台。 参考资源链接:[OpenStack与Hadoop构建的大数据分析实践](https://wenku.youkuaiyun.com/doc/54m0njv8id?spm=1055.2569.3001.10343)
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

訾零

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值