Test Hadoop mapreduce 效能


Hadoop MapReduce 效能測試

Hadoop是廣泛被使用運算平台,其中MapReduce提供平行運算的功能。而MapReduce 的架構可區分為 Map 與 Reduce 兩階段,在Hadoop JAR裡面有提供測試MapReduce的效能,接下來測試我們的Hadoop的效能,使用Hadoop Examples提供Teragen與Terasort的功能。
 
1.首先我們在Hadoop hdfs建立root帳號,將資料夾修改為root可以讀取修改的權限。
          hadoop fs -mkdir /user/root
          hadoop fs -chown root /user/root

2.建立Teragen 1250000000MB 測試資料,將資料儲存在root/teragen資料夾。
          yarn jar /usr/hdp/current/hadoop-mapreduce-client/hadoop-mapreduce-examples.jar teragen -Dmapred.map.tasks=120 1250000000 /user/root/teragen
        
3.建立完成Teragen資料,使用Terasort計算1250000000MB 資料花費時間,將資料儲存在root/terasort資料夾。
          time yarn jar /usr/hdp/current/hadoop-mapreduce-client/hadoop-mapreduce-examples.jar terasort -Dmapred.reduce.tasks=32 /user/root/teragen /user/root/terasort

4.執行完畢後,將顯示以下畫面,Terasort花費時間為40分鐘。

real    40m15.438s
user    0m21.817s
sys     0m2.856s

可以測試自已部內Hadoop效能。

刪除建立Terasort資料
           hadoop fs -rm -r /user/root/terasort

沒有留言:

張貼留言