Hadoop 0.23.1 only comes with 32bit libs. Here is how to rebuild them for your platform.
-
Install gcc, autoconf, automake, libtool, zlib-devel packages
-
Fix pom.xml to avoid classpath error when running javah:
- in
hadoop-common-project/hadoop-common/pom.xml
, find the dependency on hadoop-annotations - change the scope of the dependency from
provided
tocompile
- in
-
Build the native libs:
cd hadoop-common-project mvn package -Pnative -DskipTests # make a cup of tea while Maven downloads the internet
Libs should be created in hadoop-common-project/hadoop-common/target/native/target/usr/local/lib
To use the libs, add them to the Java library path:
java -Djava.library.path=$HADOOP_SRC/hadoop-common-project/hadoop-common/target/native/target/usr/local/lib
In the log4j logs, you should get a message like this:
util.NativeCodeLoader (NativeCodeLoader.java:50) - Loaded the native-hadoop library