Install hadoop-lzo-lib for Hadoop v1.1.1 on Mac OS X with Mountain Lion

本文提供了一步式教程,指导如何使用HomeBrew安装LZO库,并将其与Hadoop集成,包括本地代码克隆、构建过程及配置类路径和库路径。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Here is a quick guide to install hadoop lzo library, the install process is pretty easy actually.

 

  • Install LZO with HomeBrew, LZO is a wonderful compression scheme to use with Hadoop. HomeBrew is prerequisite, visit https://github.com/mxcl/homebrew to see how to install HomeBrew.
brew install lzo
  
  • Clone the hadoop-lzo source code to local:
git clone https://github.com/twitter/hadoop-lzo.git ~/code/hadoop-lzo && cd ~/code/hadoop-lzo
 
  • Build hadoop-lzo to generate hadoop-lzo-lib as well as hadoop lzo native library, find the built artifacts in the target directory.
C_INCLUDE_PATH=/usr/local/Cellar/lzo/2.06/include \
LIBRARY_PATH=/usr/local/Cellar/lzo/2.06/lib \
mvn clean test package
 Waiting for build complete. If something wrong, refer to https://github.com/twitter/hadoop-lzo for troubleshoting.
  • Copy the built artifacts into hadoop lib directory or native library directory respectively.

 

  • Once the libs are built and installed, you may want to add them to the class paths and library paths. That is, in hadoop-env.sh, set 
export HADOOP_CLASSPATH=$HADOOP_HOME/lib/hadoop-lzo-xxxx.jar
export JAVA_LIBRARY_PATH=/path/to/hadoop-lzo-native-libs:/path/to/standard-hadoop-native-libs

 

  • Note that there seems to be a bug in /path/to/hadoop/bin/hadoop; (refer to https://issues.apache.org/jira/browse/HADOOP-6453) . Comment out the line
    JAVA_LIBRARY_PATH=''

 

See https://github.com/twitter/hadoop-lzo for further instruction if you have any question or leave a comment.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值