Chapter 4. The Apache HBase Shell

Table of Contents

4.1. Scripting
4.2. Shell Tricks
4.2.1. Table variables
4.2.2. irbrc
4.2.3. LOG data to timestamp
4.2.4. Debug
4.2.5. Commands

The Apache HBase Shell is (J)Ruby's IRB with some HBase particular commands added. Anything you can do in IRB, you should be able to do in the HBase Shell.

To run the HBase shell, do as follows:

$ ./bin/hbase shell

Type help and then <RETURN> to see a listing of shell commands and options. Browse at least the paragraphs at the end of the help emission for the gist of how variables and command arguments are entered into the HBase shell; in particular note how table names, rows, and columns, etc., must be quoted.

See Procedure 1.2, “Use HBase For the First Time” for example basic shell operation.

Here is a nicely formatted listing of all shell commands by Rajeshbabu Chintaguntla.

4.1. Scripting

For examples scripting Apache HBase, look in the HBase bin directory. Look at the files that end in *.rb. To run one of these files, do as follows:

$ ./bin/hbase org.jruby.Main PATH_TO_SCRIPT
comments powered by Disqus