带有Anaconda Jupyter笔记本的Apache Toree

时间:2017-03-20 08:10:52

标签: hadoop jupyter-notebook apache-toree

我想寻求与Anaconda Jupyter笔记本相关的帮助。我想在Jupyter笔记本中编写PySpark和SparkR,然后我按照在线教程教授如何与Jupyter笔记本一起安装Apache Toree。

我正在使用Cloudera Manager parcel来管理我的kerberized Hadoop集群。

但是,我无法在服务器日志中使用以下错误打开Apache Toree PySpark的内核。

[I 15:24:50.529 NotebookApp] Creating new notebook in
[I 15:24:52.079 NotebookApp] Kernel started: 8cb4838c-2171-4672-96a4-b21ef191ffc6
Starting Spark Kernel with SPARK_HOME=/opt/cloudera/parcels/CDH/lib/spark
WARNING: User-defined SPARK_HOME (/opt/cloudera/parcels/CDH-5.9.0-1.cdh5.9.0.p2024.2115/lib/spark) overrides detected (/opt/cloudera/parcels/CDH/lib/spark).
WARNING: Running spark-class from user-defined location.
Exception in thread "main" java.lang.NoSuchMethodError: joptsimple.OptionParser.acceptsAll(Ljava/util/Collection;Ljava/lang/String;)Ljoptsimple/OptionSpecBuilder;
    at org.apache.toree.boot.CommandLineOptions.<init>(CommandLineOptions.scala:37)
    at org.apache.toree.Main$delayedInit$body.apply(Main.scala:25)
    at scala.Function0$class.apply$mcV$sp(Function0.scala:40)
    at scala.runtime.AbstractFunction0.apply$mcV$sp(AbstractFunction0.scala:12)
    at scala.App$$anonfun$main$1.apply(App.scala:71)
    at scala.App$$anonfun$main$1.apply(App.scala:71)
    at scala.collection.immutable.List.foreach(List.scala:318)
    at scala.collection.generic.TraversableForwarder$class.foreach(TraversableForwarder.scala:32)
    at scala.App$class.main(App.scala:71)
    at org.apache.toree.Main$.main(Main.scala:24)
    at org.apache.toree.Main.main(Main.scala)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.apache.spark.deploy.SparkSubmit$.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:731)
    at org.apache.spark.deploy.SparkSubmit$.doRunMain$1(SparkSubmit.scala:181)
    at org.apache.spark.deploy.SparkSubmit$.submit(SparkSubmit.scala:206)
    at org.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:121)
    at org.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)

我已将jopt-simple-4.5.jar放入Toree lib和Spark home。有什么地方我必须把罐子放在那里,以便它可以在尝试创建新笔记本时找到它?感谢。

祝你好运, 鲁卡

1 个答案:

答案 0 :(得分:2)

我找到的最简单的解决方案是将以下选项添加到spark-submit:

--conf "spark.driver.extraClassPath=/usr/local/share/jupyter/kernels/apache_toree_scala/lib/toree-assembly-0.1.0-incubating.jar" --conf "spark.executor.extraClassPath=/usr/local/share/jupyter/kernels/apache_toree_scala/lib/toree-assembly-0.1.0-incubating.jar"

可以将其添加到__TOREE_SPARK_OPTS__文件的/usr/local/share/jupyter/kernels/apache_toree_scala/kernel.json变量中,也可以直接添加到/usr/local/share/jupyter/kernels/apache_toree_scala/bin/run.sh文件中的bash命令。

通过添加这个,你强制类加载器从Toree JAR加载joptsimple.OptionParser而不是从默认的CDH库加载。{/ p>

P上。 S.这是与CDH 5.10.0兼容的Toree版本:https://github.com/Myllyenko/incubator-toree/releases