Zeppelin与Spark2

时间:2017-07-19 02:38:59

标签: apache-spark cloudera apache-zeppelin

我正在尝试配置Zeppelin以在cloudera中使用Spark2和cloudera版本5.10.1 Screenshot of the spark interpreter

我收到错误“org.apache.zeppelin.interpreter.InterpreterException:opt / cloudera / parcels / SPARK2-2.1.0.cloudera1-1.cdh5.7.0.p0.120904 / bin / spark2-submit / bin / spark-submit:不是目录“

显然,它将“/ bin / spark-submit”附加到路径中。我该如何纠正?

2 个答案:

答案 0 :(得分:3)

您应该将变量SPARK_HOME(在zeppelin安装的文件conf / zeppelin-env.sh中)设置为spark安装的基目录,即" / opt / cloudera /parcels/SPARK2-2.1.0.cloudera1-1.cdh5.7.0.p0.120904/" ;.如果(附加)问题是" spark2-submit"的名称。 vs." spark-submit"然后我会用

在shell上创建一个符号链接
cd /opt/cloudera/parcels/SPARK2-2.1.0.cloudera1-1.cdh5.7.0.p0.120904/bin/
ln -s spark2-submit spark-submit

答案 1 :(得分:2)

将SPARK_HOME设置为" /opt/cloudera/parcels/SPARK2-2.1.0.cloudera1-1.cdh5.7.0.p0.120904 /"可能还不够。在我的情况下,当我将SPARK_HOME设置为:

时,spark2开始在zeppelin中工作
  

SPARK_HOME = /选择/ Cloudera的/包裹/ SPARK2 / LIB / spark2

* SPARK2链接到该较长的包裹名称。

进一步发展我的答案。解决@molotow在zeppelin中给出了这样的错误:

org.apache.zeppelin.interpreter.InterpreterException: /opt/cloudera/parcels/SPARK2/bin/spark-submit: line 17: //../../CDH/lib/bigtop-utils/bigtop-detect-javahome: No such file or directory
/opt/cloudera/parcels/SPARK2/bin/spark-submit: line 19: //../lib/spark2/bin/spark-submit: No such file or directory

这可能与如何' spark2-submit'试图找到它需要工作的路径。主要是:

#!/bin/bash
  # Reference: http://stackoverflow.com/questions/59895/can-a-bash-script-tell-what-directory-its-stored-in
  SOURCE="${BASH_SOURCE[0]}"
  BIN_DIR="$( dirname "$SOURCE" )"
  while [ -h "$SOURCE" ]
  do
    SOURCE="$(readlink "$SOURCE")"
    [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE"
    BIN_DIR="$( cd -P "$( dirname "$SOURCE"  )" && pwd )"
  done
  BIN_DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
  CDH_LIB_DIR=$BIN_DIR/../../CDH/lib
  LIB_DIR=$BIN_DIR/../lib
export HADOOP_HOME=$CDH_LIB_DIR/hadoop

希望有人帮助。 :)