Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

I am trying to schedule a shell script which has few shell codes and a spark module is called from there which connects to HBase to ger some data, but when I triger the workflow. It is unable to connect to HBase.it shows retries exhausted?

avatar

I am tring to schedule a script in which a folder will be uploaded to hdfs and then it will be downloaded to machine on which oozie schedules the job.

From there that script will run eg: sh thatdownloadedscript.sh

in that script i have connected to hbase shell and just listed tables

but it gives me following error:

HBase Shell; enter 'help<RETURN>' for list of supported commands. Type "exit<RETURN>" to leave the HBase Shell Version 1.1.2.2.5.0.0-1245, r53538b8ab6749cbb6fdc0fe448b89aa82495fb3f, Fri Aug 26 01:32:27 UTC 2016 count 'DRM_Email1' ERROR: No valid credentials provided (Mechanism level: Failed to find any Kerberos tgt) Here is some help for this command: Count the number of rows in a table. Return value is the number of rows. This operation may take a LONG time (Run '$HADOOP_HOME/bin/hadoop jar hbase.jar rowcount' to run a counting mapreduce job). Current count is shown every 1000 rows by default. Count interval may be optionally specified. Scan caching is enabled on count scans by default. Default cache size is 10 rows. If your rows are small in size, you may want to increase this parameter. Examples:

8 REPLIES 8

avatar
Super Guru

@Rupesh Agarwal,

Looks like your cluster is kerberized. You have to run kinit before running hbase shell.

kinit -kt /etc/security/keytabs/hbase.headless.keytab <princ>

Also, run your hbase shell in non interactive mode.

echo "list" | hbase shell -n 

Thanks,

Aditya

avatar

what is this file and what is that tag <princ>

avatar
Super Guru

@Rupesh Agarwal,

<princ> is the user principal. Here is the example if you don't know what is the value of princ.

[root@xxx ~]# klist -kte /etc/security/keytabs/hbase.headless.keytab
Keytab name: FILE:/etc/security/keytabs/hbase.headless.keytab
KVNO Timestamp         Principal
---- ----------------- --------------------------------------------------------
   1 09/10/17 14:06:14 hbase@EXAMPLE.COM (aes128-cts-hmac-sha1-96)
   1 09/10/17 14:06:14 hbase@EXAMPLE.COM (arcfour-hmac)
   1 09/10/17 14:06:14 hbase@EXAMPLE.COM (des-cbc-md5)
   1 09/10/17 14:06:14 hbase@EXAMPLE.COM (des3-cbc-sha1)
   1 09/10/17 14:06:14 hbase@EXAMPLE.COM (aes256-cts-hmac-sha1-96)

Run klist and observer the output, here hbase@EXAMPLE.COM is the principal. Now you can run kinit as below

kinit -kt /etc/security/keytabs/hbase.headless.keytab hbase@EXAMPLE.COM

avatar

What is that

<princ> sorry i am new to this

avatar

it is saying permission denied

klist -kte /etc/security/keytabs/hbase.headless.keytab Keytab name: FILE:/etc/security/keytabs/hbase.headless.keytab klist: Permission denied while starting keytab scan

avatar
Super Guru

Does the user have permissions to read the file. Check the permissions on the file or run it using sudo.

ls -l /etc/security/keytabs/hbase.headless.keytab

avatar

ok so, suppose if i put a spark submit command in jar and that jar contains code to connect to hbase then how to pass this

avatar
Super Guru