齐柏林飞艇与Kubernetes。在非本地模式的解释器设置中未指定SPARK_HOME

时间:2019-04-12 08:23:05

标签: docker apache-spark kubernetes apache-zeppelin

我在Kubernetes集群(Minikube)中有一个Spark集群(Master + 2 Workers)。

我想在我的k8s集群中添加Zeppelin,并将其配置为使用我的Spark集群。

所以我尝试使用Zeppelin 0.8.1 image from apache/zeppelinanother image built on Zeppelin 0.9.0-SNAPSHOT (still in develop)

我遵循了官方的Zeppelin documentation(即使它尚未发布,也至少需要一个齐柏林飞艇0.9.0)\ _(ツ)_ /¯)

我做了什么:

  • 拉起齐柏林飞艇docker image
  • 构建Spark docker映像
  • 从文档中下载zeppelin-server.yaml
  • 对其进行编辑,以便他具有指向我的本地Spark图像和Zeppelin图像的正确路径
  • kubectl apply -f(火花和齐柏林飞艇yaml文件)

然后我浏览Zeppelin笔记本,并尝试运行一个小型火花测试以查看其是否有效,但出现以下错误:

java.lang.RuntimeException: SPARK_HOME is not specified in interpreter-setting for non-local mode, if you specify it in zeppelin-env.sh, please move that into interpreter setting 
    at org.apache.zeppelin.interpreter.launcher.SparkInterpreterLauncher.setupPropertiesForSparkR(SparkInterpreterLauncher.java:181) 
    at org.apache.zeppelin.interpreter.launcher.SparkInterpreterLauncher.buildEnvFromProperties(SparkInterpreterLauncher.java:63) 
    at org.apache.zeppelin.interpreter.launcher.StandardInterpreterLauncher.launch(StandardInterpreterLauncher.java:86) 
    at org.apache.zeppelin.interpreter.InterpreterSetting.createInterpreterProcess(InterpreterSetting.java:698) 
    at org.apache.zeppelin.interpreter.ManagedInterpreterGroup.getOrCreateInterpreterProcess(ManagedInterpreterGroup.java:63) 
    at org.apache.zeppelin.interpreter.remote.RemoteInterpreter.getOrCreateInterpreterProcess(RemoteInterpreter.java:110) 
    at org.apache.zeppelin.interpreter.remote.RemoteInterpreter.internal_create(RemoteInterpreter.java:163) 
    at org.apache.zeppelin.interpreter.remote.RemoteInterpreter.open(RemoteInterpreter.java:131) 
    at org.apache.zeppelin.interpreter.remote.RemoteInterpreter.getFormType(RemoteInterpreter.java:290) 
    at org.apache.zeppelin.notebook.Paragraph.jobRun(Paragraph.java:402) 
    at org.apache.zeppelin.notebook.Paragraph.jobRun(Paragraph.java:75) 
    at org.apache.zeppelin.scheduler.Job.run(Job.java:172) 
    at org.apache.zeppelin.scheduler.AbstractScheduler.runJob(AbstractScheduler.java:121) 
    at org.apache.zeppelin.scheduler.RemoteScheduler$JobRunner.run(RemoteScheduler.java:187) 
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) 
    at java.util.concurrent.FutureTask.run(FutureTask.java:266) 
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) 
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) 
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) 
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) 
    at java.lang.Thread.run(Thread.java:748)

首先,即使我不使用Spark R,我仍然看到错误来自函数setupPropertiesForSparkR()

但是我迷失的主要是,因为我使用Zeppelin和Spark docker映像,所以我不知道如何设置SPARK_HOME以及它应该具有什么值。

注意:

  • 我使用Spark 2.4.0
  • 我还尝试手动构建Zeppelin映像,但是使用开发中的源,构建失败)

1 个答案:

答案 0 :(得分:0)

您可以使用以下方法配置环境变量:

docker run --env SPARK_HOME=/path ...

您还可以使用Spark集群创建卷

docker run --env SPARK_HOME=/pathInCluster -v /pathYourSparkCluster:/pathInCluster ...