Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
HBase Administration Cookbook

You're reading from  HBase Administration Cookbook

Product type Book
Published in Aug 2012
Publisher Packt
ISBN-13 9781849517140
Pages 332 pages
Edition 1st Edition
Languages
Author (1):
Yifeng Jiang Yifeng Jiang
Profile icon Yifeng Jiang

Table of Contents (16) Chapters

HBase Administration Cookbook
Credits
About the Author
Acknowledgement
About the Reviewers
www.PacktPub.com
Preface
Setting Up HBase Cluster Data Migration Using Administration Tools Backing Up and Restoring HBase Data Monitoring and Diagnosis Maintenance and Security Troubleshooting Basic Performance Tuning Advanced Configurations and Tuning

Row counter


The count command in HBase Shell is a straightforward way to count the row numbers on an HBase table. However, running the count command on a table with a huge amount of data might take a long time to complete. A better approach for this case is to use the RowCounter class. This class will kick a MapReduce job to count the row number on a table, which is much more efficient than the count command.

We will describe the usage of RowCounter in this recipe.

Getting ready

Make sure your Hadoop and HBase clusters are running. MapReduce is also required; if it is not running, start it by using the following command on your JobTracker server:

hadoop@master1$ $HADOOP_HOME/bin/start-mapred.sh

Log in to your HBase client node.

How to do it...

To run a row counter MapReduce job on the hly_temp table, follow these steps:

  1. 1. Add a ZooKeeper JAR file to the Hadoop class path on your client node:

    hadoop@client1$ vi $HADOOP_HOME/conf/hadoop-env.sh
    HBASE_HOME=/usr/local/hbase/current
    export HADOOP_CLASSPATH...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}