Created 02-21-2017 05:49 PM
I'm running a test hbase java program via oozie java action. The following error is encountered :
Error, java.lang.NoClassDefFoundError: org/apache/hadoop/hbase/HBaseConfiguration at org.apache.oozie.action.hadoop.HbaseCredentials.copyHbaseConfToJobConf(HbaseCredentials.java:67) at org.apache.oozie.action.hadoop.HbaseCredentials.addtoJobConf(HbaseCredentials.java:55) at org.apache.oozie.action.hadoop.JavaActionExecutor.setCredentialTokens(JavaActionExecutor.java:1287) at org.apache.oozie.action.hadoop.JavaActionExecutor.submitLauncher(JavaActionExecutor.java:1124) at org.apache.oozie.action.hadoop.JavaActionExecutor.start(JavaActionExecutor.java:1373) at org.apache.oozie.command.wf.ActionStartXCommand.execute(ActionStartXCommand.java:232) at org.apache.oozie.command.wf.ActionStartXCommand.execute(ActionStartXCommand.java:63) at org.apache.oozie.command.XCommand.call(XCommand.java:287) at org.apache.oozie.service.CallableQueueService$CompositeCallable.call(CallableQueueService.java:331) at org.apache.oozie.service.CallableQueueService$CompositeCallable.call(CallableQueueService.java:260) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at org.apache.oozie.service.CallableQueueService$CallableWrapper.run(CallableQueueService.java:178) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745)
The program runs correctly from command line :
java -cp `hbase classpath` personal_project.HBaseConnector
Is there a way I can pass output of 'hbase classpath' to the oozie java action. I have copied below hbase jars to workflow's lib directory as well.
Following is the java action from workflow.xml
:
<workflow-app xmlns="uri:oozie:workflow:0.5" name="hbase_connect"> <global> <job-tracker>${job_tracker}</job-tracker> <name-node>${name_node}</name-node> </global> <credentials> <credential name="hbase-cred" type="hbase"> <property> <name>hadoop.security.authentication</name> <value>kerberos</value> </property> <property> <name>hbase.security.authentication</name> <value>kerberos</value> </property> <property> <name>hbase.master.kerberos.principal</name> <value>hbase/_HOST@XX.XX.COM</value> </property> <property> <name>hbase.regionserver.kerberos.principal</name> <value>hbase/_HOST@XX.XX.COM</value> </property> <property> <name>hbase.zookeeper.quorum</name> <value>${zookeeper_quorum}</value> </property> <property> <name>hadoop.rpc.protection</name> <value>authentication</value> </property> <property> <name>hbase.rpc.protection</name> <value>authentication</value> </property> </credential> </credentials> <start to="hbase_connect_java" /> <action name="hbase_connect_java" cred="hbase-cred"> <java> <job-xml>${runconfig_dir}/hbase-site.xml</job-xml> <main-class>personal_project.HBaseConnector</main-class> <java-opts>-Dsun.security.krb5.debug=true</java-opts> <arg>${name_node}</arg> <arg>${kerberos_principal}</arg> <arg>${kerberos_keytab_file}</arg> <arg>a:xxx,b:yyy,c:zzz,d:yyy</arg> <arg>2016-02-22-123456</arg> <file>${path_hdfs_common}/lib/hbase_connect.jar#hbase_connect.jar</file> <file>${runconfig_dir}/jaas.conf#jaas.conf</file> <file>${runconfig_dir}/krb5.conf#krb5.conf</file> <file>${runconfig_dir}/hbase-site.xml#hbase-site.xml</file> </java> <ok to="end"/> <error to="fail"/> </action> <kill name="fail"> <message>${wf:name()} workflow failed, error message[${wf:errorMessage(wf:lastErrorNode())}]</message> </kill> <end name="end"/> </workflow-app>
Created 02-23-2017 09:56 AM
Adding the below Credential properties fixed my issue.
<credentials> <credential name="hbase-cred" type="hbase"> <property> <name>hadoop.security.authentication</name> <value>kerberos</value> </property> <property> <name>hbase.security.authentication</name> <value>kerberos</value> </property> <property> <name>hbase.master.kerberos.principal</name> <value>hbase/_HOST@XX.XX.COM</value> </property> <property> <name>hbase.regionserver.kerberos.principal</name> <value>hbase/_HOST@XX.XX.COM</value> </property> <property> <name>hbase.zookeeper.quorum</name> <value>${zookeeper_quorum}</value> </property> <property> <name>hadoop.rpc.protection</name> <value>authentication</value> </property> <property> <name>hbase.rpc.protection</name> <value>authentication</value> </property> <property> <name>hbase.master.keytab.file</name> <value>/etc/hadoop/hbase.keytab</value> </property> <property> <name>hbase.regionserver.keytab.file</name> <value>/etc/hadoop/hbase.keytab</value> </property> </credential> </credentials>
Created 02-21-2017 11:20 PM
@Padmanabhan Vijendran Check if ozzie shared lib is configured properly and has right hbase dependencies. If not properly configured you can recreate shared lib using below commands:
/usr/hdp/current/oozie/bin/oozie-setup.sh sharelib create -locallib /usr/hdp/<version>/oozie/oozie-sharelib.tar.gz -fs hdfs://<namenode-host>:8020
oozie admin -oozie http://<oozie-host>:11000/oozie -sharelibupdate
Created 02-22-2017 08:04 AM
@Ajay I am not an admin to do this. I believe sharelib is properly set. Hive Actions are running fine.
Created 02-23-2017 09:56 AM
Adding the below Credential properties fixed my issue.
<credentials> <credential name="hbase-cred" type="hbase"> <property> <name>hadoop.security.authentication</name> <value>kerberos</value> </property> <property> <name>hbase.security.authentication</name> <value>kerberos</value> </property> <property> <name>hbase.master.kerberos.principal</name> <value>hbase/_HOST@XX.XX.COM</value> </property> <property> <name>hbase.regionserver.kerberos.principal</name> <value>hbase/_HOST@XX.XX.COM</value> </property> <property> <name>hbase.zookeeper.quorum</name> <value>${zookeeper_quorum}</value> </property> <property> <name>hadoop.rpc.protection</name> <value>authentication</value> </property> <property> <name>hbase.rpc.protection</name> <value>authentication</value> </property> <property> <name>hbase.master.keytab.file</name> <value>/etc/hadoop/hbase.keytab</value> </property> <property> <name>hbase.regionserver.keytab.file</name> <value>/etc/hadoop/hbase.keytab</value> </property> </credential> </credentials>