1.將編譯好後的hadoop-lzo-0.4.20.jar 放入hadoop-3.1.3/share/hadoop/common/
2.同步hadoop-lzo-0.4.20.jar到hadoop103、hadoop104
3.core-site.xml增加配置支援lzo壓縮
io.compression.codecs
org.apache.hadoop.io.compress.gzipcodec,
org.apache.hadoop.io.compress.defaultcodec,
org.apache.hadoop.io.compress.bzip2codec,
com.hadoop.compression.lzo.lzocodec,
com.hadoop.compression.lzo.lzopcodec
io.compression.codec.lzo.class
com.hadoop.compression.lzo.lzocodec
4.同步hadoop-lzo-0.4.20.jar到hadoop103、hadoop104
xsync hadoop-lzo-0.4.20.jar
5.core-site.xml增加配置支援lzo壓縮
io.compression.codecs
org.apache.hadoop.io.compress.gzipcodec,
org.apache.hadoop.io.compress.defaultcodec,
org.apache.hadoop.io.compress.bzip2codec,
com.hadoop.compression.lzo.lzocodec,
com.hadoop.compression.lzo.lzopcodec
io.compression.codec.lzo.class
com.hadoop.compression.lzo.lzocodec
6.同步core-site.xml到hadoop103、hadoop104
xsync core-site.xml
7.啟動及檢視集群
sbin/start-dfs.sh
sbin/start-yarn.sh
1)建立lzo檔案的索引,lzo壓縮檔案的可切片特性依賴於其索引,故我們需要手動為lzo壓縮檔案建立索引。若無索引,則lzo檔案的切片只有乙個。
hadoop jar /path/to/your/hadoop-lzo.jarcom.hadoop.compression.lzo.distributedlzoindexerbig_file.lzo
2)測試
(1)將bigtable.lzo(150m)上傳到集群的根目錄
hadoop fs -mkdir /input
hadoop fs -put bigtable.lzo /input
(2)執行wordcount程式
$ hadoop jar /opt/module/hadoop-3.1.3/share/hadoop/mapreduce/hadoop-mapreduce-examples-3.1.3.jar wordcount /input /output1
(3)對上傳的lzo檔案建索引
$ hadoop jar /opt/module/hadoop-3.1.3/share/hadoop/common/hadoop-lzo-0.4.20.jar com.hadoop.compression.lzo.distributedlzoindexer /input/bigtable.lzo
(4)再次執行wordcount程式
$ hadoop jar /opt/module/hadoop-3.1.3/share/hadoop/mapreduce/hadoop-mapreduce-examples-3.1.3.jar wordcount /input /output2
hadoop支援Lzo壓縮配置及案例
hadoop支援lzo壓縮配置 1 hadoop本身並不支援lzo壓縮,故需要使用twitter提供的hadoop lzo開源元件。hadoop lzo需依賴hadoop和lzo進行編譯,編譯步驟如下。2 將編譯好後的hadoop lzo 0.4.20.jar 放入hadoop 2.7.2 shar...
Hadoop新增LZO壓縮支援
啟用lzo的壓縮方式對於小規模集群是很有用處,壓縮比率大概能降到原始日誌大小的1 3。同時解壓縮的速度也比較快。3 將編譯好後的hadoop lzo 0.4.20.jar 放入hadoop 2.7.2 share hadoop common root bigdata 01 common pwd ex...
Nginx使用經驗之支援跨域
之前在公司搭建了一台fastdfs檔案伺服器,使用一直正常。但某天乙個前端同事反饋,使用中遇到個問題 他用乙個外掛程式獲取檔案伺服器上的檔案,卻報了異常 access to fetch at http ip port xx m00 00 00 abc.pdf from origin null has...