Compile hadoop-2.2.0 source code with maven under 64-bit operating system

WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
appears when

starting start-dfs.sh Solution The
official native library is only 32-bit, so we need to recompile the source code on the 64-bit system to get the 64-bit native library. When compiling the
operating system Centos 6.5
, linux needs to be connected to the Internet, because maven needs to download the hadoop dependency package and
install jdk

Install maven 3.0 above 1.6 
to set maven environment variables (verify mvn -version).
   Execute yum install gcc
   Execute yum install gcc-c++
      Execute yum install make to
decompress protobuf 2.5.0
cd In the decompressed directory
execute ./configure
  execute make
  execute make install
install cmake
yum install cmake
yum install openssl-devel
yum install ncurses-devel
Download hadoop source code hadoop-2.2.0-src.tar.gz Unzip the file
Modify hadoop/hadoop-common-project/hadoop-auth/pom.xml file
<!--Start of new content-->
<dependency>
       <groupId>org.mortbay.jetty</groupId>
     <artifactId>jetty-util</artifactId>
     <scope>test</scope>
   </dependency>
<!--end of new additions-->
   < dependency>
    <groupId>org.mortbay.jetty</groupId>
       <artifactId>jetty</artifactId>
       <scope>test</scope>
     </dependency> Execute mvn package -Pdist
in the hadoop decompression directory ,native -DskipTests -Dtar starts compiling hadoop source code The compiled  source code is in the hadoop-2.2.0 folder in the target directory






Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326345748&siteId=291194637