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
(并發任務數)。