How to start Mahout Spark Shell?

2019-09-12 05:26发布

问题:

I am trying to use mahout for spark and followed the instruction below: https://mahout.apache.org/users/sparkbindings/play-with-shell.html

I have successfully installed oracle-7-java, maven 3.3.9. Instead of spark 1.1.0 I have downloaded spark 2.0.1 and ran build/sbt assembly which took care of scala (install 2.11.8) and other dependencies. I have also installed git, and checked out latest version of mahout in /home/mehrab/mahout-src directory.

Spark is running well and fine without any error. Mahout is also built successfully without any error. After running spark and taking the master url, I have set JAVA_HOME, SPARK_HOME, MAHOUT_HOME, MASTER.

So meeting all requirement when I finally try to launch mahout shell by running bin/mahout spark-shell it gives me following error:

 mehrab@ubuntu:~/mahout-src$ bin/mahout spark-shell
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/spark/repl/SparkILoop
    at org.apache.mahout.sparkbindings.shell.Main.main(Main.scala)
Caused by: java.lang.ClassNotFoundException: org.apache.spark.repl.SparkILoop
    at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
    ... 1 more

Can anyone help? Thanks in advance.