LZO的安裝

hadoop-lzo的安裝:
----------------------
1.本地庫的安裝
     獲取到安裝包lzo-2.10.tar.gz 後
     執行下列命令:
                    tar -zxvf lzo-2.06.tar.gz -C /opt/tool/
                    cd /opt/tool/lzo-2.06/
                    mkdir /usr/local/lzo
                    ./configure --enable-shared --prefix /usr/local/lzo
                    make & sudo makeinstall
                    
2.hadoop-lzo的jar包製作
    解壓下載過來的hadoop-lzo-master.zip:  unzip hadoop-lzo-master.zip 
    在解壓目錄下執行下列命令:
                            export CFLAGS=-m64
                            export CXXFLAGS=-m64
                            export LIBRARY_PATH=/usr/local/lzo/lib 
                            export C_INCLUDE_PATH=/usr/local/lzo/include 
                            export LIBRARY_PATH=/usr/local/lzo/lib 
                            mvn clean package -Dmaven.test.skip=true
                            cd target/native/Linux-amd64-64
                            tar -cBf - -C lib . | tar -xBvf - -C ~ <產生連接文件>
                            mv ~/libgplcompression* $HADOOP_HOME/lib/native/  <將連接文件拷貝到hadoop相應目錄下>
    
3.將mvn打包的hadoop-lzo-0.4.20-SNAPSHOT.jar複製到hadoop的common目錄下

然後就可以開始使用Lzo了

 


轉載內容

轉載於  https://www.cnblogs.com/xd502djj/p/4878335.html

[root@xd502djj ~]# yum install lzop

Loaded plugins: fastestmirror

Determining fastest mirrors

 * base: mirrors.btte.net

 * extras: mirrors.yun-idc.com

 * updates: mirrors.yun-idc.com

base                                                                                                                                                     | 3.7 kB     00:00    

extras                                                                                                                                                   | 3.4 kB     00:00    

extras/primary_db                                                                                                                                        |  32 kB     00:00    

updates                                                                                                                                                  | 3.4 kB     00:00    

updates/primary_db                                                                                                                                       | 1.9 MB     00:10    

Setting up Install Process

Resolving Dependencies

--> Running transaction check

---> Package lzop.x86_64 0:1.02-0.9.rc1.el6 will be installed

--> Processing Dependency: liblzo2.so.2()(64bit) for package: lzop-1.02-0.9.rc1.el6.x86_64

--> Running transaction check

---> Package lzo.x86_64 0:2.03-3.1.el6_5.1 will be installed

--> Finished Dependency Resolution

 

Dependencies Resolved

 

================================================================================================================================================================================

 Package                               Arch                                    Version                                              Repository                             Size

================================================================================================================================================================================

Installing:

 lzop                                  x86_64                                  1.02-0.9.rc1.el6                                     base                                   50 k

Installing for dependencies:

 lzo                                   x86_64                                  2.03-3.1.el6_5.1                                     base                                   55 k

 

Transaction Summary

================================================================================================================================================================================

Install       2 Package(s)

 

Total download size: 105 k

Installed size: 253 k

Is this ok [y/N]: y

Downloading Packages:

(1/2): lzo-2.03-3.1.el6_5.1.x86_64.rpm                                                                                                                   |  55 kB     00:00    

(2/2): lzop-1.02-0.9.rc1.el6.x86_64.rpm                                                                                                                  |  50 kB     00:00    

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Total                                                                                                                                           184 kB/s | 105 kB     00:00    

Running rpm_check_debug

Running Transaction Test

Transaction Test Succeeded

Running Transaction

  Installing : lzo-2.03-3.1.el6_5.1.x86_64                                                                                                                                  1/2

  Installing : lzop-1.02-0.9.rc1.el6.x86_64                                                                                                                                 2/2

  Verifying  : lzop-1.02-0.9.rc1.el6.x86_64                                                                                                                                 1/2

  Verifying  : lzo-2.03-3.1.el6_5.1.x86_64                                                                                                                                  2/2

 

Installed:

  lzop.x86_64 0:1.02-0.9.rc1.el6                                                                                                                                               

 

Dependency Installed:

  lzo.x86_64 0:2.03-3.1.el6_5.1                                                                                                                                                

 

Complete!

[root@vm2070 ~]# lzop

                          Lempel-Ziv-Oberhumer Packer

   Copyright (C) 1996199719981999200020012002200320042005

lzop v1.02rc1      Markus Franz Xaver Johannes Oberhumer         Jul 25th 2005

 

Usage: lzop [-dxlthIVL19] [-qvcfFnNPkUp] [-o file] [-S suffix] [file..]

 

Commands:

  -1     compress faster                   -9    compress better

  -d     decompress                        -x    extract (same as -dPp)

  -l     list compressed file              -I    display system information

  -t     test compressed file              -V    display version number

  -h     give this help                    -L    display software license

Options:

  -q     be quiet                          -v       be verbose

  -c     write on standard output          -oFILE   write output to `FILE'

  -p     write output to current dir       -pDIR    write to path `DIR'

  -f     force overwrite of output files

  -n     do not restore the original file name (default)

  -N     restore the original file name

  -P     restore or save the original path and file name

  -S.suf use suffix .suf on compressed files

  -U     delete input files after successful operation (like gzip and bzip2)

  file.. files to (de)compress. If none given, try standard input.

--------------------

 

2、安裝lzo  操作如下:  wget http://www.oberhumer.com/opensource/lzo/download/lzo-2.06.tar.gz   export CFLAGS=-m32    ./configure -enable-shared   make && make install    完成之後,lib庫文件被默認安裝到了/usr/local/lib,我們需要進一步指定lzo庫文件的路徑,兩個方法都可以:    1)拷貝/usr/local/lib目錄下的lzo庫文件到/usr/lib(32位平臺),或/usr/lib64(64位平臺)   2)在/etc/ld.so.conf.d/目錄下新建lzo.conf文件,只需寫入lzo庫文件的路徑(/usr/local/lib),然後運行以下命令使配置生效: 

3 安裝lzop  LZOP是使用lzo庫寫的一個程序,通過shell命令直接可以壓縮、解壓縮文件。    #下載    Wget http://www.lzop.org/download/lzop-1.03.tar.gz   #解壓縮、進入項目目錄(略過)   ./configure   make    make install      用一下lzop的壓縮解壓功能,成功安裝後可直接使用lzop命令對文件進行解壓縮操作了。  # 壓縮   lzop 20110915.log #生成lzop 20110915.log.lzo文件      # 解壓,並輸出文件內容   lzop -cdpv.txt.lzo |more

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章