apache toree和anaconda jupyter笔记本

lxkprmvk  于 2021-05-29  发布在  Hadoop
关注(0)|答案(1)|浏览(505)

我想寻求帮助有关anaconda jupyter笔记本。我想在jupyter笔记本中编写pyspark和sparkr,并且我遵循了在线教程,该教程教授如何将apache toree与jupyter笔记本一起安装。
我正在使用cloudera管理器包来管理我的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中。有没有什么地方,我必须把jar放在那里,以便它可以找到它时,试图创建新的笔记本?谢谢。
祝你好运,鲁卡

bf1o4zei

bf1o4zei1#

我发现的最简单的解决方案是添加以下选项来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 文件中的bash命令 /usr/local/share/jupyter/kernels/apache_toree_scala/bin/run.sh 文件。
通过添加这个命令,可以强制类加载器加载 joptsimple.OptionParser 从toreejar而不是从默认的cdh库。
第。s。以下是与cdh 5.10.0兼容的toree版本:https://github.com/myllyenko/incubator-toree/releases

相关问题