1,安装lzo

curl -O http://www.oberhumer.com/opensource/lzo/download/lzo-2.10.tar.gz
tar zxvf lzo-2.10.tar.gz
cd lzo-2.10/
export CFLAGS=-m64
./configure -enable-shared
make && sudo make install
sudo touch /etc/ld.so.conf.d/lzo.conf 
sudo sh -c 'echo /usr/local/lib >/etc/ld.so.conf.d/lzo.conf'  

sudo /sbin/ldconfig -v

# 查看一下
ldconfig -p | grep lzo

2,安装lzop(可选)

curl -O http://www.lzop.org/download/lzop-1.04.tar.gz 
tar zxvf lzop-1.04.tar.gz
cd lzop-1.04/ 
./configure
make && sudo make install

# 验证一下
lzop -h

3,安装hadoop-lzo

假设已经安装配置好了maven

git clone https://github.com/twitter/hadoop-lzo
cd hadoop-lzo/
export CFLAGS=-m64
export CXXFLAGS=-m64
export C_INCLUDE_PATH=/usr/local/include/lzo
export LIBRARY_PATH=/usr/local/lib
mvn clean package -Dmaven.test.skip=true

# 在target目录下,会看到hadoop-lzo-0.4.21-SNAPSHOT.jar包
cp ~/hadoop-lzo-0.4.21-SNAPSHOT.jar presto-server-0.184/plugin/hive-hadoop2/hadoop-lzo-0.4.21-SNAPSHOT.jar

注意事项