Created 01-19-2016 12:01 PM
Hi,
I am trying to access a HBase-backed Hive table via 'select * from tbl_name', but seems like some HBase jar's are not in place.
Any help highly appreciated 😉
Details:
0: jdbc:hive2://deala.corp:1> select * from tbl_name; Error: java.lang.NoClassDefFoundError: org/apache/hadoop/hbase/HBaseConfiguration (state=,code=0)
Regards, Gerd
PS: HDP2.2.4.2, Ambari 2.1.2
Created 01-19-2016 12:24 PM
Append HBASE_CLASSPATH to HADOOP_CLASSPATH like below:-
export HADOOP_CLASSPATH=$HADOOP_CLASSPATH:$HBASE_CLASSPATH
//but before that confirm HBASE_CLASSPATH is properly set.
And
also you may need to set hive.aux.jars.path in hive-site.xml so that libraries are available in MR job.
<property> <name>hive.aux.jars.path</name> <value><hive_home>/lib/hive-hbase-handler-<version>.jar, <hbase_home>/lib/hbase-client-<version>.jar, <hbase_home>/lib/hbase-server-<version>.jar,<hbase_home>/lib/hbase-protocol-<version>.jar,<hbase_home>/lib/zookeeper-<version>.jar</value> <description>A comma separated list (with no spaces) of the jar files required for Hive-HBase integration</description> </property>
replace the above paths with actual paths as per your setup.
Created 01-19-2016 12:24 PM
Append HBASE_CLASSPATH to HADOOP_CLASSPATH like below:-
export HADOOP_CLASSPATH=$HADOOP_CLASSPATH:$HBASE_CLASSPATH
//but before that confirm HBASE_CLASSPATH is properly set.
And
also you may need to set hive.aux.jars.path in hive-site.xml so that libraries are available in MR job.
<property> <name>hive.aux.jars.path</name> <value><hive_home>/lib/hive-hbase-handler-<version>.jar, <hbase_home>/lib/hbase-client-<version>.jar, <hbase_home>/lib/hbase-server-<version>.jar,<hbase_home>/lib/hbase-protocol-<version>.jar,<hbase_home>/lib/zookeeper-<version>.jar</value> <description>A comma separated list (with no spaces) of the jar files required for Hive-HBase integration</description> </property>
replace the above paths with actual paths as per your setup.
Created 01-19-2016 11:52 PM
Hi,
just to extend @asinghal 's answer, the whole solution was:
1) adding
export HADOOP_CLASSPATH=$HADOOP_CLASSPATH:$HBASE_CLASSPATH
to hadoop-env section in Ambari=>HDFS=>config
2) restart HDFS (will be shown in Ambari to restart all affected services)
3) restart Hive (this won't show up in Ambari, but needs to be restarted to apply the change from steps 1. and 2.)
Regards....
Created 01-20-2016 06:49 AM
Thanks @Gerd Koenig for extending the answer in terms of ambari and HDP.