Reply
Explorer
Posts: 9
Registered: ‎11-04-2016
Accepted Solution

Spark 2.2 and Livy

Hello,

 

I have both Spark 1.6 and Spark 2.2 installed in my cluster through CDH. Normally my Livy server starts with default Spark 1.6 but now I want to start my Livy with Spark 2.2 which I figured maybe by changing the SPARK_HOME to point to SPARK2 would do the trick:

 

Previously:

export SPARK_HOME=/opt/cloudera/parcels/CDH/lib/spark

export SPARK_CONF_DIR=$SPARK_HOME/conf

 

New:

export SPARK_HOME=/opt/cloudera/parcels/SPARK2

export SPARK_CONF_DIR=$SPARK_HOME/meta

 

But this will led to an error which is understandable as Spark2 in Cloudera is spark2-submit:

 

Exception in thread "main" java.io.IOException: Cannot run program "/opt/cloudera/parcels/SPARK2/bin/spark-submit": error=2, No such file or directory


Is there anyway to configure the Livy to find the right spark2-submit and not the default name? I looked every where in the config and the code but maybe I missed something.

 

Many thanks,

Maziyar

Highlighted
Posts: 614
Topics: 3
Kudos: 91
Solutions: 59
Registered: ‎08-16-2016

Re: Spark 2.2 and Livy

I haven't done this yet but it should do the trick. You need to update the alternatives to make Spark2 the default. This will make it the default across the board and not just for Livy. So make sure you are ready for that.

https://www.cloudera.com/documentation/spark2/latest/topics/spark2_admin.html
Explorer
Posts: 9
Registered: ‎11-04-2016

Re: Spark 2.2 and Livy

It worked! I just ran the script on the node that is my Livy server. 

 

Thank you :)

Announcements