Support Questions

Find answers, ask questions, and share your expertise

Spark 2.2 and Livy

avatar
Expert Contributor

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

1 ACCEPTED SOLUTION

avatar
Champion
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

View solution in original post

4 REPLIES 4

avatar
Champion
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

avatar
Expert Contributor

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

 

Thank you 🙂

avatar
New Contributor

Is there a way of doing this without having to make Spark2 the default? I tried to search among Livy conf parameters, but I couldn't find anything.

avatar
Expert Contributor
The Spark 2 now is the only Spark that is supported by CDH 6.x so I am not sure you will get any reply here.
Is there any reason you are still in Spark 1.6.x?