How to use Hbase shell in a bash script?

0 votes
Can anyone provide small example how to use HBase Shell in a Bash script?
May 29, 2019 in Big Data Hadoop by Nishan
748 views

1 answer to this question.

0 votes

Hello,

To write scripts with HBase shell it includes non-interactive mode, this mode allows you to use HBase Shell in scripts, and allow the script to access the exit status of the HBase Shell commands. To invoke non-interactive mode, use the switch:

-n or --non-interactive 

This small example script shows how to use HBase Shell in a Bash script.

!/bin/bash
echo 'list' | hbase shell -n
status=$?
if [$status -ne 0]; then
  echo "The command may have failed."

 

answered May 29, 2019 by Gitika
• 36,610 points

Related Questions In Big Data Hadoop

0 votes
1 answer

How to Modify the Maximum Number of Versions for a Column Family in Hbase?

Hey, The example uses HBase Shell to keep ...READ MORE

answered May 31, 2019 in Big Data Hadoop by Gitika
• 36,610 points
592 views
0 votes
1 answer

How to Create a table with region replication in Hbase?

Hi, Region replication is a per-table property. All ...READ MORE

answered May 31, 2019 in Big Data Hadoop by Gitika
• 36,610 points
313 views
0 votes
1 answer

How to delete a column family from table in HBase?

Hey, You can delete a column family from ...READ MORE

answered Jun 20, 2019 in Big Data Hadoop by Gitika
• 36,610 points
946 views
0 votes
1 answer

How to check the directory is present in shell script or not?

Hi, To check the directory is present in ...READ MORE

answered Jun 24, 2019 in Big Data Hadoop by Gitika
• 36,610 points
76 views
0 votes
1 answer
+1 vote
1 answer

Hadoop Mapreduce word count Program

Firstly you need to understand the concept ...READ MORE

answered Mar 16, 2018 in Data Analytics by nitinrawat895
• 10,950 points
5,823 views
0 votes
1 answer

hadoop.mapred vs hadoop.mapreduce?

org.apache.hadoop.mapred is the Old API  org.apache.hadoop.mapreduce is the ...READ MORE

answered Mar 16, 2018 in Data Analytics by nitinrawat895
• 10,950 points
872 views
+1 vote
11 answers

hadoop fs -put command?

put syntax: put <localSrc> <dest> copy syntax: copyF ...READ MORE

answered Dec 7, 2018 in Big Data Hadoop by Aditya
36,594 views
0 votes
1 answer

How to kill a Backup Master in HBase?

Hey, To kill a backup master, you need ...READ MORE

answered May 23, 2019 in Big Data Hadoop by Gitika
• 36,610 points
231 views
0 votes
1 answer

How to create a Table using HBase shell ?

Hey, You can create a table using the create command, ...READ MORE

answered May 23, 2019 in Big Data Hadoop by Gitika
• 36,610 points
157 views