1. 程式人生 > >cdh5.13 配置LZO壓縮模式

cdh5.13 配置LZO壓縮模式

  1. 下載安裝包

wget http://archive.cloudera.com/gplextras5/parcels/5.13.3/GPLEXTRAS-5.13.3-1.cdh5.13.3.p0.2-el7.parcel

wget http://archive.cloudera.com/gplextras5/parcels/5.13.3/GPLEXTRAS-5.13.3-1.cdh5.13.3.p0.2-el7.parcel.sha1

wget http://archive.cloudera.com/gplextras5/parcels/5.13.3/manifest.json

mv GPLEXTRAS-5.13.3-1.cdh5.13.3.p0.2-el7.parcel.sha1 GPLEXTRAS-5.13.3-1.cdh5.13.3.p0.2-el7.parcel.sha

點選分配按鈕

之後進入啟用狀態中

至此,lzo服務安裝工作已經完成。                                                                                                                                                                                 

修改配置叢集的lzo服務                                                                                    

修改HDFS配置                              

在io.compression.codecs屬性值中追加如下值:                                       

com.hadoop.compression.lzo.LzoCodec                                                

com.hadoop.compression.lzo.LzopCodec   

修改YARN配置

將mapreduce.application.classpath的屬性值增加一項:

/opt /cloudera/parcels/HADOOP_LZO/lib/hadoop/lib/*

 

如下圖所示:

 

 

修改MR應用程式環境

修改mapreduce.admin.user.env的屬性值,增加一項:

 

/opt/cloudera/parcels/GPLEXTRAS/lib/hadoop/lib/native,如下圖所示:

重啟叢集生效。

flume採集日誌的機器也要安裝lzo包才可以以壓縮的結果輸入到hdfs

wget http://mirror.centos.org/centos/7/os/x86_64/Packages/lzo-devel-2.06-8.el7.x86_64.rpm

yum install -y lzo-devel

測試結果如下大約節省2/3的空間:

壓縮前的日誌大小:

壓縮後的資料