Why does ./bin/spark-shell give WARN NativeCodeLoader: Unable to load native-hadoop library for your platform?

前端 未结 2 766
情深已故
情深已故 2020-12-09 03:20

On Mac OS X, I compiled Spark from the sources using the following command:

jacek:~/oss/spark
$ SPARK_HADOOP_VERSION=2.4.0 SPARK_YARN=true SPARK_HIVE=true SP         


        
相关标签:
2条回答
  • 2020-12-09 03:48

    Supported Platforms of the Native Libraries Guide documentation in Apache Hadoop reads:

    The native hadoop library is supported on *nix platforms only. The library does not to work with Cygwin or the Mac OS X platform.

    The native hadoop library is mainly used on the GNU/Linus platform and has been tested on these distributions:

    • RHEL4/Fedora
    • Ubuntu
    • Gentoo

    On all the above distributions a 32/64 bit native hadoop library will work with a respective 32/64 bit jvm.

    It appears that the WARN message should be disregarded on Mac OS X as the native library doesn't simply exist for the platform.

    0 讨论(0)
  • 2020-12-09 03:59

    In my experience, if you cd into the /sparkDir/conf and rename the spark-env.sh.template to spark-env.sh, and then set the JAVA_OPTSand hadoop_DIR, it works.

    You will also have to edit this /etc/profile line:

    export LD_LIBRARY_PATH=$HADOOP_HOME/lib/native/:$LD_LIBRARY_PATH
    
    0 讨论(0)
提交回复
热议问题