Using Spark Hive Warehouse and HBase Connector Client .jar files with Livy
This section describes how to use Spark Hive Warehouse Connector (HWC) and HBase-Spark connector client .jar files with Livy. These steps are required to ensure token acquisition and avoid authentication errors.
Use the following steps to use Spark HWC and HBase-Spark client .jar files with Livy:
- Copy the applicable HWC or HBase-Spark .jar files to the Livy server node and add
these folders to the
livy.file.local-dir-whitelist
property in thelivy.conf
file. - Add the required Hive and HBase configurations in the Spark client configuration
folder:
Hive: /etc/spark3/conf/hive-site.xml
HBase: /etc/spark3/conf/hbase-site.xml
conf
field in the session creation request. This is equivalent to using "--conf" in spark-submit. - Reference these local .jar files in the session creation request using the
file:///
URI format.
HWC Example
- In Cloudera Manager, go to .
- Click the Configuration tab and search for the "Livy Server Advanced Configuration Snippet (Safety Valve) for livy-conf/livy.conf" property.
- Add the /opt/cloudera/parcels/CDH-[*** CLOUDERA VERSION ***]/jars folder to
the
livy.file.local-dir-whitelist
property in thelivy.conf
file. - Save the changes and restart the Livy service.
- Log in to the Zeppelin Server Web UI and restart the Livy interpreter.
- When running the Zeppelin Livy interpreter, reference the HWC .jar file as shown
below.
- For Spark 3:
%livy2.conf livy.spark.jars file:///opt/cloudera/parcels/CDH-[*** CLOUDERA VERSION ***]/jars/hive-warehouse-connector-spark3-assembly-[*** PARCEL VERSION ***].jar
- For Spark 3:
HBase-Spark Connector Example
- When running the Zeppelin Livy interpreter, reference the following HBase .jar
files as shown below. Note that some of these .jar files have 644/root
permissions, and therefore may throw an exception. If this happens, you may need
to change the permissions of the applicable .jar files on the Livy node.
%livy.conf livy.spark.jars file:///opt/cloudera/parcels/CDH-[*** CLOUDERA VERSION ***]/jars/hbase-spark3-[*** PARCEL VERSION ***].jar file:///opt/cloudera/parcels/CDH-[*** CLOUDERA VERSION ***]/jars/hbase-shaded-protobuf-[*** PARCEL VERSION ***].jar, file:///opt/cloudera/parcels/CDH-[*** CLOUDERA VERSION ***]/jars/hbase-shaded-miscellaneous-[*** PARCEL VERSION ***].jar, file:///opt/cloudera/parcels/CDH-[*** CLOUDERA VERSION ***]/jars/hbase-protocol-shaded-[*** PARCEL VERSION ***].jar, file:///opt/cloudera/parcels/CDH-[*** CLOUDERA VERSION ***]/jars/hbase-shaded-netty-[*** PARCEL VERSION ***].jar, file:///opt/cloudera/parcels/CDH-[*** CLOUDERA VERSION ***]/jars/hbase-shaded-client-[*** PARCEL VERSION ***].jar, file:///opt/cloudera/parcels/CDH-[*** CLOUDERA VERSION ***]/jars/hbase-shaded-mapreduce-[*** PARCEL VERSION ***].jar, file:///opt/cloudera/parcels/CDH-[*** CLOUDERA VERSION ***]/jars/hbase-common-[*** PARCEL VERSION ***].jar, file:///opt/cloudera/parcels/CDH-[*** CLOUDERA VERSION ***]/jars/hbase-server-[*** PARCEL VERSION ***].jar, file:///opt/cloudera/parcels/CDH-[*** CLOUDERA VERSION ***]/jars/hbase-client-[*** PARCEL VERSION ***].jar, file:///opt/cloudera/parcels/CDH-[*** CLOUDERA VERSION ***]/jars/hbase-protocol-[*** PARCEL VERSION ***].jar, file:///opt/cloudera/parcels/CDH-[*** CLOUDERA VERSION ***]/jars/hbase-mapreduce-[*** PARCEL VERSION ***].jar, ile:///opt/cloudera/parcels/CDH-[*** CLOUDERA VERSION ***]/jars/guava-32.1.3-jre.jar