ubuntu14.04 编译hadoop2.5

int32位 posted @ Aug 19, 2014 09:03:50 PM in java , 2645 阅读
转载请注明:http://krystism.is-programmer.com/若有错误,请多多指正,谢谢!

ubuntu13.10或以下版本也可以编译,只是源中maven和protobuf都版本太低,需要自己下源码重新编译安装,很繁琐。

hadoop2.5有编译好的发布包,但是默认是64位的,老是出现以下错误

OpenJDK Server VM warning: You have loaded library /hadoop/lib/native/libhadoop.so.1.0.0 which might have disabled stack guard. The VM will try to fix the stack guard now.
It's highly recommended that you fix the library with 'execstack -c <libfile>', or link it with '-z noexecstack'.
14/08/19 21:07:42 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable

看起来好像只是警告无所谓,但在启动脚本中NAMENODES=$(hdfs getconf  -namenodes),这时会把所有以上输出以空格作为分隔符作为namenode,显然出错,而且没法加载本地库,所以必须进行重新build。

网上很多说修改HADOOP_OPTS可以解决以上问题,但我试过很多次,根本不行,其实想想也是不可能的,64位的库怎么可以运行在32位呢!

从官方http://www.apache.org/dyn/closer.cgi/hadoop/core/下载源码。

源码是使用maven进行管理的,要求版本必须是maven3以上,由于maven调用了ant,因此ant也是必要的。

另外本地库使用c写的,还要求有cmake,make,auto工具,否则无法编译。总结以下是必要的包:

maven3.0+
libssl-dev
cmake
protobuf2.5+
jdk1.6+
zlib
auto工具(比如automake,autoconf)
make
openssl
build-essential
然后就可以运行 mvn package -Pdist,native -DskipTests -Dtar 进行重新构建。
另外注意JAVA_HOME环境变量的设置,必须确保JAVA_HONE/bin下有javah。
当编译一次后发现问题并不多,但这已经足够折腾我一天了,主要是由于maven编译时错误信息不太清楚,没有很清楚的说明问题所在,而只是抛出一堆异常,外部调用的auto工具和make工具的错误信息又没有显示,所以我是通过手动调用cmake和make去找问题的,否则半天不知道怎么回事。
转载请注明:http://krystism.is-programmer.com/若有错误,请多多指正,谢谢!
  • 无匹配
  • 无匹配
شركة الشايع للخدمات 说:
2021年3月03日 20:28

A company specializing in the maintenance of home appliances in Riyadh and Jeddah

شركة مكافحة الحشرات 说:
2021年3月03日 20:30

A company specializing in the maintenance of home appliances in Riyadh and Jeddah

فحص فلل ومباني 说:
2021年3月03日 23:37

A company specializing in the maintenance of home appliances in Riyadh and Jeddah

شركة عزل فوم 说:
2021年3月03日 23:49

A company specializing in the maintenance of home appliances in Riyadh and Jeddah

شركة تسليك مجاري 说:
2021年3月03日 23:50

A company specializing in the maintenance of home appliances in Riyadh and Jeddah

AP 10th computer Mod 说:
2022年9月11日 01:39

Since the Government of AP also provided Computer labs for students in all Government schools also.Computer Knowledge is very much essential nowadays. Even Checking the Results of various examinations, AP 10th computer Model Paper Downloading hall tickets and study materials for multiple exams and booking tickets etc ..need minimum Technical Knowledge is much more important for everyone. Since the Government of AP also provided Computer labs for students in all Government schools also.


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter