NoClassDefFoundError com.apache.hadoop.fs.FSDataInputStream when execute spark-shell

前端 未结 14 1154
北荒
北荒 2020-11-30 02:07

I\'ve downloaded the prebuild version of spark 1.4.0 without hadoop (with user-provided Haddop). When I ran the spark-shell command, I got this error:

> E         


        
14条回答
  •  天命终不由人
    2020-11-30 02:25

    I had the same problem, in fact it's mentioned on the Getting started page of Spark how to handle it:

    ### in conf/spark-env.sh ###
    
    # If 'hadoop' binary is on your PATH
    export SPARK_DIST_CLASSPATH=$(hadoop classpath)
    
    # With explicit path to 'hadoop' binary
    export SPARK_DIST_CLASSPATH=$(/path/to/hadoop/bin/hadoop classpath)
    
    # Passing a Hadoop configuration directory
    export SPARK_DIST_CLASSPATH=$(hadoop --config /path/to/configs classpath)
    

    If you want to use your own hadoop follow one of the 3 options, copy and paste it into spark-env.sh file :

    1- if you have the hadoop on your PATH

    2- you want to show hadoop binary explicitly

    3- you can also show hadoop configuration folder

    http://spark.apache.org/docs/latest/hadoop-provided.html

提交回复
热议问题