Hadoop “Unable to load native-hadoop library for your platform” warning

后端 未结 21 1118
礼貌的吻别
礼貌的吻别 2020-11-22 03:48

I\'m currently configuring hadoop on a server running CentOs. When I run start-dfs.sh or stop-dfs.sh, I get the following error:

相关标签:
21条回答
  • 2020-11-22 04:02

    I had the same issue. It's solved by adding following lines in .bashrc:

    export HADOOP_COMMON_LIB_NATIVE_DIR=$HADOOP_HOME/lib/native
    export HADOOP_OPTS="-Djava.library.path=$HADOOP_HOME/lib"
    
    0 讨论(0)
  • 2020-11-22 04:05

    This line right here:

    export JAVA_LIBRARY_PATH=$HADOOP_HOME/lib/native:$JAVA_LIBRARY_PATH
    

    From KunBetter's answer is where the money is

    0 讨论(0)
  • 2020-11-22 04:07
    export JAVA_HOME=/home/hadoop/software/java/jdk1.7.0_80
    export HADOOP_HOME=/usr/local/hadoop
    export HADOOP_COMMON_LIB_NATIVE_DIR=$HADOOP_HOME/lib/native
    export HADOOP_OPTS="-Djava.library.path=$HADOOP_COMMON_LIB_NATIVE_DIR"
    
    0 讨论(0)
  • 2020-11-22 04:08

    This line right here:

    export JAVA_LIBRARY_PATH=$HADOOP_HOME/lib/native:$JAVA_LIBRARY_PATH
    

    From KunBetter's answer, worked for me. Just append it to .bashrc file and reload .bashrc contents

    $ source ~/.bashrc
    
    0 讨论(0)
  • 2020-11-22 04:09

    @zhutoulala -- FWIW your links worked for me with Hadoop 2.4.0 with one exception I had to tell maven not to build the javadocs. I also used the patch in the first link for 2.4.0 and it worked fine. Here's the maven command I had to issue

    mvn package -Dmaven.javadoc.skip=true -Pdist,native -DskipTests -Dtar
    

    After building this and moving the libraries, don't forget to update hadoop-env.sh :)

    Thought this might help someone who ran into the same roadblocks as me

    0 讨论(0)
  • 2020-11-22 04:10

    Just append word native to your HADOOP_OPTS like this:

    export HADOOP_OPTS="$HADOOP_OPTS -Djava.library.path=$HADOOP_HOME/lib/native"
    

    PS: Thank Searene

    0 讨论(0)
提交回复
热议问题