Snappy數據壓縮 配置到Hadoop
依賴庫:yum -y install gcc+ gcc-c++
官方文檔中提到編譯前提需要:gcc c++, autoconf, automake, libtool, Java 6, JAVA_HOME set, Maven 3
1:下載所需的動態庫和hadoop snappy插件工程
snappy-1.1.2.tar.gz 動態庫
source-archive Maven Jar
2:編譯snappy-1.1.2.tar.gz (gcc g++ 等)
./configure
make
make install
成功了在usr/local/lib下有動態庫文件
-rw-r--r--. 1 root root 330020 Jun 6 11:42 libsnappy.a
-rwxr-xr-x. 1 root root 953 Jun 6 11:42 libsnappy.la
lrwxrwxrwx. 1 root root 18 Jun 6 11:42 libsnappy.so -> libsnappy.so.1.2.1
lrwxrwxrwx. 1 root root 18 Jun 6 11:42 libsnappy.so.1 -> libsnappy.so.1.2.1
-rwxr-xr-x. 1 root root 164196 Jun 6 11:42 libsnappy.so.1.2.1
3:maven編輯source-archive下truch包
PS:安裝MAVEN
wget http://repos.fedorapeople.org/repos/dchen/apache-maven/epel-apache-maven.repo -O /etc/yum.repos.d/epel-apache-maven.repo
yum -y install apache-maven
遇到問題:
mvn package
Error: Could not find or load main class org.codehaus.plexus.classworlds.launcher.Launcher
是因為maven環境沒導入 執行:export M2_HOME=/usr/share/maven export PATH=$PATH:$M2_HOME/bin
隨後編譯:mvn package
遇到問題:
Cannot run program "autoreconf" 安裝上面提到的依賴庫
cannot find -ljvm 這個錯誤是因為沒有把安裝jvm的libjvm.so 鏈接到 /usr/local/lib。如果你的系統時amd64,可以執行如下命令解決這個問題:
ln -s /usr/java/jdk1.7.0_75/jre/lib/amd64/server/libjvm.so /usr/local/lib/
隨後獲取編譯成功的jar
Snappy數據壓縮 配置到Hadoop