重新編譯hadoop-2.7.2-src的native以支援Snappy解壓壓縮庫
1. 下載所需要的原始碼包 snappy-1.1.1.tar.gz、protobuf-2.5.0.tar.gz、hadoop-2.7.2-src.tar.gz
[root@sht-sgmhadoopnn-01 ~]# cd /hadoop
[root@sht-sgmhadoopnn-01 hadoop]# mkdir native_snappy
[root@sht-sgmhadoopnn-01 hadoop]# cd native_snappy
[root@sht-sgmhadoopnn-01 native_snappy]# wget
--2016-06-21 15:23:35--
Resolving pkgs.fedoraproject.org... 209.132.181.4
Connecting to pkgs.fedoraproject.org|209.132.181.4|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1777992 (1.7M) [application/x-gzip]
Saving to: “snappy-1.1.1.tar.gz”
100%[==========================================================================================================================>] 1,777,992 56.2K/s in 32s
2016-06-21 15:24:08 (54.8 KB/s) - “snappy-1.1.1.tar.gz” saved [1777992/1777992]
You have mail in /var/spool/mail/root
[root@sht-sgmhadoopnn-01 native_snappy]#
###百度雲盤下載,然後rz上傳
[root@sht-sgmhadoopnn-01 native_snappy]# rz
rz waiting to receive.
Starting zmodem transfer. Press Ctrl+C to cancel.
Transferring protobuf-2.5.0.tar.gz...
100% 2345 KB 2345 KB/sec 00:00:01 0 Errors
You have mail in /var/spool/mail/root
[root@sht-sgmhadoopnn-01 native_snappy]#
[root@sht-sgmhadoopnn-01 native_snappy]# wget
--2016-06-21 15:37:46--
Resolving apache.01link.hk... 101.78.134.82
Connecting to apache.01link.hk|101.78.134.82|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 18290860 (17M) [application/x-gzip]
Saving to: “hadoop-2.7.2-src.tar.gz”
100%[==========================================================================================================================>] 18,290,860 248K/s in 54s
2016-06-21 15:38:40 (330 KB/s) - “hadoop-2.7.2-src.tar.gz” saved [18290860/18290860]
You have mail in /var/spool/mail/root
[root@sht-sgmhadoopnn-01 native_snappy]#
[root@sht-sgmhadoopnn-01 native_snappy]# ls -l
total 21952
-rw-r--r-- 1 root root 18290860 Jan 26 09:29 hadoop-2.7.2-src.tar.gz
-rw-r--r-- 1 root root 2401901 Jun 21 15:28 protobuf-2.5.0.tar.gz
-rw-r--r-- 1 root root 1777992 Feb 24 2014 snappy-1.1.1.tar.gz
[root@sht-sgmhadoopnn-01 native_snappy]#
2. 準備編譯環境
[root@host /]# yum -y install svn
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
Setting up Install Process
No package svn available.
[root@sht-sgmhadoopnn-01 yum.repos.d]# lsb_release -a
LSB Version: :base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch
Distributor ID: CentOS
Description: CentOS release 6.5 (Final)
Release: 6.5
Codename: Final
You have mail in /var/spool/mail/root
[root@sht-sgmhadoopnn-01 yum.repos.d]#
###Centos yum 安裝軟體 No package XXX available. http://blog.itpub.net/30089851/viewspace-2120628/
[root@sht-sgmhadoopnn-01 yum.repos.d]# yum install svn
[root@sht-sgmhadoopnn-01 yum.repos.d]# yum install autoconf automake libtool cmake
[root@sht-sgmhadoopnn-01 yum.repos.d]# yum install ncurses-devel
[root@sht-sgmhadoopnn-01 yum.repos.d]# yum install openssl-devel
[root@sht-sgmhadoopnn-01 yum.repos.d]# yum install gcc*
3. 編譯安裝snappy
# 用root使用者執行以下命令
[root@sht-sgmhadoopnn-01 native_snappy]#tar -zxvf snappy-1.1.1.tar.gz
[root@sht-sgmhadoopnn-01 native_snappy]# cd snappy-1.1.1/
[root@sht-sgmhadoopnn-01 snappy-1.1.1]# ./configure
[root@sht-sgmhadoopnn-01 snappy-1.1.1]# make
[root@sht-sgmhadoopnn-01 snappy-1.1.1]# make install
4. 檢視snappy庫檔案
[root@sht-sgmhadoopnn-01 snappy-1.1.1]# ls -lh /usr/local/lib |grep snappy
-rw-r--r-- 1 root root 229K Jun 21 15:46 libsnappy.a
-rwxr-xr-x 1 root root 953 Jun 21 15:46 libsnappy.la
lrwxrwxrwx 1 root root 18 Jun 21 15:46 libsnappy.so -> libsnappy.so.1.2.0
lrwxrwxrwx 1 root root 18 Jun 21 15:46 libsnappy.so.1 -> libsnappy.so.1.2.0
-rwxr-xr-x 1 root root 145K Jun 21 15:46 libsnappy.so.1.2.0
[root@sht-sgmhadoopnn-01 snappy-1.1.1]#
5. 編譯安裝protobuf
# 用root使用者執行以下命令
[root@hadoop-01 snappy-1.1.1]# cd ../
You have mail in /var/spool/mail/root
[root@hadoop-01 native_snappy]# tar -zxvf protobuf-2.5.0.tar.gz
[root@hadoop-01 native_snappy]# cd protobuf-2.5.0/
[root@hadoop-01 protobuf-2.5.0]# ./configure
[root@hadoop-01 protobuf-2.5.0]# make
[root@hadoop-01 protobuf-2.5.0]# make install
# 檢視protobuf版本以測試是否安裝成功
[root@hadoop-01 protobuf-2.5.0]# protoc --version
protoc: error while loading shared libraries: libprotobuf.so.8: cannot open shared object file: No such file or directory
[root@hadoop-01 protobuf-2.5.0]# export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
You have mail in /var/spool/mail/root
[root@hadoop-01 protobuf-2.5.0]# protoc --version
libprotoc 2.5.0
[root@hadoop-01 protobuf-2.5.0]#
6. 編譯hadoop native
[root@hadoop-01 native_snappy]# tar -zxvf hadoop-2.7.2-src.tar.gz
[root@hadoop-01 native_snappy]# cd hadoop-2.7.2-src/
[root@hadoop-01 hadoop-2.7.2-src]# mvn clean package -DskipTests -Pdist,native -Dtar -Dsnappy.lib=/usr/local/lib -Dbundle.snappy
.........
.........
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 20:58 min
[INFO] Finished at: 2016-06-21T19:12:51+08:00
[INFO] Final Memory: 179M/521M
[INFO] ------------------------------------------------------------------------
[root@hadoop-01 hadoop-2.7.2-src]#
7.執行成功後,hadoop-dist/target/hadoop-2.7.2.tar.gz即為新生成的二進位制安裝包。
[root@hadoop-01 hadoop-2.7.2-src]# ll hadoop-dist/target/hadoop-2.7.2.tar.gz
-rw-r--r-- 1 root root 195117479 Jun 21 19:12 hadoop-dist/target/hadoop-2.7.2.tar.gz
[root@hadoop-01 hadoop-2.7.2-src]#
8.重新命名為hadoop-2.7.2-snappy.tar.gz
[root@sht-sgmhadoopnn-01 hadoop-2.7.2-src]# cp hadoop-dist/target/hadoop-2.7.2.tar.gz /tmp/hadoop-2.7.2-snappy.tar.gz
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/30089851/viewspace-2120631/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 配置Hadoop2.7.2和Hbase1.1.5支援Snappy解壓壓縮庫HadoopAPP
- hadoop2.6.0-cdh5.7.0編譯,支援snappy、bzip2本地壓縮HadoopH5編譯APP
- linux壓縮解壓縮Linux
- 在EMR中使用snappy壓縮的時候快速檢視壓縮前文字的內容APP
- aix 下壓縮與解壓縮AI
- tar 分卷壓縮&解壓縮命令
- AIX 上壓縮與解壓縮AI
- aix 檔案的壓縮與解壓縮AI
- Linux壓縮解壓Linux
- linux 高效壓縮工具之xz的壓縮解壓使用Linux
- Linux下常用壓縮格式的壓縮與解壓方法Linux
- tar的打包-壓縮與解壓縮,並解壓到指定的目錄
- linux下壓縮解壓縮命令Linux
- Linux壓縮及解壓縮命令Linux
- 分卷壓縮怎麼解壓 快速解壓電腦分卷壓縮檔案方法
- Linux 常用的壓縮與解壓縮命令詳解Linux
- Linux下的tar壓縮解壓縮命令詳解Linux
- linux壓縮(解壓縮)命令詳解-轉Linux
- linuxtar解壓和壓縮Linux
- MyZip for mac解壓壓縮工具Mac
- Keka for Mac(壓縮解壓工具)Mac
- Keka for Mac壓縮解壓工具Mac
- 壓縮解壓命令(tar, zip)
- linux分卷壓縮解壓Linux
- .NET 壓縮/解壓檔案
- Linux科研武器庫 - 檔案壓縮與解壓縮 - zip / unzipLinux
- 字串的壓縮和解壓縮字串
- Kafka - 支援壓縮種類Kafka
- Linux tar分卷壓縮與解壓縮Linux
- Linux下常用壓縮格式的壓縮與解壓方法---轉載Linux
- zlib庫編譯過程遇到的問題及其使用zlib庫進行解壓縮編譯
- Hadoop上配置snappy壓縮格式(最簡單的做法)HadoopAPP
- Hbase無法建立帶有snappy壓縮屬性的表APP
- uboot 解壓縮boot
- bootmgr解壓縮boot
- zip解壓縮
- Nginx網路壓縮 CSS壓縮 圖片壓縮 JSON壓縮NginxCSSJSON
- A-Zippr for Mac 壓縮解壓工具Mac