一、测试写入速度
- 确保HDFS集群和YARN集群成功启动
hadoop jar /export/server/hadoop-3.1.4/share/hadoop/mapreduce/hadoop-mapreduce-client-jobclient-3.1.4-tests.jar TestDFSIO -write -nrFiles 10 -fileSize 10MB
说明:向HDFS文件系统中写入数据,10个文件,每个文件10MB,文件存到/benchmarks/TestDFSIO中。 Throughput:吞吐量、Average IO rate:平均IO率、IO rate std deviation:IO率标准偏差

二、测试读取速度
- 确保HDFS集群和YARN集群成功启动
hadoop jar /export/server/hadoop-3.1.4/share/hadoop/mapreduce/hadoop-mapreduce-client-jobclient-3.1.4-tests.jar TestDFSIO -read -nrFiles 10 -fileSize 10MB
说明:在HDFS文件系统中读入10个文件,每个文件10M
Throughput:吞吐量、Average IO rate:平均IO率、IO rate std deviation:IO率标准偏差

三、清除测试数据
- 确保HDFS集群成功启动 hadoop jar /export/server/hadoop-3.1.4/share/hadoop/mapreduce/hadoop-mapreduce-client-jobclient-3.1.4-tests.jar TestDFSIO -clean
说明:测试期间,会在HDFS集群上创建 /benchmarks目录,测试完毕后,我们可以清理该目录。
