Ubuntu环境下HDFS性能测试指南
core-site.xml、hdfs-site.xml);关闭非必要服务(如SecondaryNameNode、Balancer),避免资源竞争。/test),避免残留数据影响结果(可通过hdfs dfs -rm -r /test命令删除)。wordcount、terasort),模拟真实业务负载。yarn jar /path/to/hadoop-mapreduce-client-jobclient-tests.jar TestDFSIO -write -nrFiles 10 -size 1GB -resFile /path/to/write_result.log
参数说明:-nrFiles(文件数量)、-size(单个文件大小)、-resFile(结果保存路径)。yarn jar /path/to/hadoop-mapreduce-client-jobclient-tests.jar TestDFSIO -read -nrFiles 10 -size 1GB -resFile /path/to/read_result.log
result.log中的Throughput(吞吐量,单位MB/s)、Average IO Rate(平均I/O速率)等指标。mvn -Phadoopbench -Psparkbench -Dspark=3.0 -Dscala=2.12 -Dhadoop=3.2 clean package -e
conf/hadoop.conf(设置Hadoop安装路径)和conf/spark.conf(设置Spark安装路径)。frameworks.lst文件,添加需要测试的项目(如hdfs_read、hdfs_write)。./bin/run_all.sh
HiBench Report目录下查看HTML报告,包含各用例的吞吐量、延迟等指标。fio -filename /home/ubuntu/test.log -direct 1 -iodepth 1 -thread -rw read -ioengine psync -bs 16k -size 2G -numjobs 10 -runtime 60 -group_reporting -name test_r
fio -filename /home/ubuntu/test.log -direct 1 -iodepth 1 -thread -rw write -ioengine psync -bs 16k -size 2G -numjobs 10 -runtime 60 -group_reporting -name test_w
-direct 1(绕过缓存,测试真实磁盘性能)、-iodepth 1(I/O队列深度)、-rw(读写模式)、-bs(块大小)、-size(测试文件大小)、-numjobs(并发任务数)。