Expert Contributor
Posts: 64
Registered: ‎11-04-2016
Accepted Solution

Spark 2.2 and Livy



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:



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




export SPARK_HOME=/opt/cloudera/parcels/SPARK2



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


Exception in thread "main" 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,


Posts: 642
Topics: 3
Kudos: 120
Solutions: 67
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.
Expert Contributor
Posts: 64
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 :)