EDUCBA

EDUCBA

MENUMENU
  • Free Tutorials
  • Free Courses
  • Certification Courses
  • 360+ Courses All in One Bundle
  • Login
Home Data Science Data Science Tutorials Hadoop Tutorial HBase Commands
Secondary Sidebar
Hadoop Tutorial
  • Commands
    • Hadoop Commands
    • Hadoop fs Commands
    • Hadoop FS Command List
    • HDFS Commands
    • HDFS ls
    • Hadoop Stack
    • HBase Commands
  • Basics
    • What is Hadoop
    • Career in Hadoop
    • Advantages of Hadoop
    • Uses of Hadoop
    • Hadoop Versions
    • HADOOP Framework
    • Hadoop Architecture
    • Hadoop Configuration
    • Hadoop Components
    • Hadoop WordCount
    • Hadoop Database
    • Hadoop Ecosystem
    • Hadoop Tools
    • Install Hadoop
    • Is Hadoop Open Source
    • What is Hadoop Cluster
    • Hadoop Namenode
    • Hadoop data lake
    • Hadoop fsck
    • HDFS File System
    • Hadoop Distributed File System
  • Advanced
    • What is Yarn in Hadoop
    • Hadoop?Administrator
    • Hadoop DistCp
    • Hadoop Administrator Jobs
    • Hadoop Schedulers
    • Hadoop Distributed File System (HDFS)
    • Hadoop Streaming
    • Apache Hadoop Ecosystem
    • Distributed Cache in Hadoop
    • Hadoop Ecosystem Components
    • Hadoop YARN Architecture
    • HDFS Architecture
    • What is HDFS
    • HDFS Federation
    • Apache HBase
    • HBase Architecture
    • What is Hbase
    • HBase Shell Commands
    • What is MapReduce in Hadoop
    • Mapreduce Combiner
    • MapReduce Architecture
    • MapReduce Word Count
    • Impala Shell
    • HBase Create Table
  • Interview Questions
    • Hadoop Admin Interview Questions
    • Hadoop Cluster Interview Questions
    • Hadoop developer interview Questions
    • HBase Interview Questions

Related Courses

Data Science Certification

Online Machine Learning Training

Hadoop Certification

MapReduce Certification Course

HBase Commands

By Priya PedamkarPriya Pedamkar

HBase Commands

Introduction to HBase Commands

HBase Command is an Open-source Framework. It runs on the Hadoop file distributed System (HDFS) use to store sparse data sets. The key components of HBase are Zookeeper, Region, HBase Master. Hbase consists of active HBase Master server and one Region Server. Hmaster is responsible for monitoring the all-region server in a cluster. Hbase automatically partitioned into regions. Regions are stored in a file in a distributed manner. They provide random read and write operation on large datasets. They are horizontally scalable (any no. of columns can be added) and two key structures of HBase are row and column key respectively.

Basic HBase Commands (Operational Commands) are

After base Installation, interactive shell to execute commands:

HBase Commands

Data Definition Language / Data Manipulation Commands

  • Create: It creates a new table.

Data Definition Language

Start Your Free Data Science Course

Hadoop, Data Science, Statistics & others

  • Put: Inserts a new tuple into the record.

Put Inserts a new tuple into the record

  • Scan: It returns the data stored in the table.

Scan It returns the data stored in the table.

  • Get: It returns the record.

Get It returns the record.

  • Help: List all the commands.

base(main): 020:0> list ‘namespace name: mydb’

Help List all the commands.

  • Drop: To delete a specific cell in a table.

Drop To delete a Specific cell in a table.

  • To disable the table:

Syntax: disable ‘dataTable.’

To disable the table

  • Updating data: To update the column, a new column value set for the same row key is created. No Update keyword is used here.

Example: Update dataTable(row key 112) to change the rating to ‘8’:

  • Truncate: This command keeps the schema but not the records.

Syntax: hbase> truncate <tablename>

HBAse Commands - Truncate

  • Describe: Used to describe the Existing namespace.

HBAse Commands - describe

The above output screenshot gives the following explanations:

All in One Data Science Bundle(360+ Courses, 50+ projects)
Python TutorialMachine LearningAWSArtificial Intelligence
TableauR ProgrammingPowerBIDeep Learning
Price
View Courses
360+ Online Courses | 50+ projects | 1500+ Hours | Verifiable Certificates | Lifetime Access
4.7 (86,584 ratings)

Scanning table ‘invoice’ with attributes RAW=>true, VERSIONS=>0.

Displaying rows with column families and values in the table.

It displays random output not the same order as the values that inserted in the table

Intermediate Hbase Commands

  • Create: They are used to create a table in HBase.

example: create ‘table name’, <column family>’

  • disable: It is used to disable a created table.

example: Hbase> disable ‘table name’

  • is_disabled: This command verifies whether a table has been disabled.

example: hbase> is disabled ‘table name.’

1. Security Commands

Below Hbase commands are used to provide the security to the database from unauthorized users.

  • Grant: This command gives right permission access to read, write, execute.

example: hbase>grant< username> <permissions>[<tablename> [col name]

  • Revoke: This command used to revoke user access of a table.

example:hbase> revoke<user>

  • User_permissions: This command list all the access given to the table

example: hbase>user_permission ‘table name’

2. Cluster Replication Commands

They are executed when cluster set up done in Hbase to stop/add replication of clusters.

  • Add peer: to add peer to clusters to replicate the data

example: hbase>add_peer ‘4’, zk4, zk5, zk6, zk7:/hbase-prod

  • Start_replication: deletes all the metadata information on the peer.

example:hbase>start_replication

  • Stop replication: Stops all the replication process

example:hbase>stop_replication

3. Configuring Table commands

  • pme_config: This command is used to get a table’s deployment status and configuration. They write the configuration to HBase/HDFS.
  • pme_dump: This command helps with debugging and troubleshooting. They output the information on the table.
  • pme_set_autocompare: This command sets the autocomparerecords configuration property temporarily for the PME table.
  • pme_set_autoderive: This command sets the autoderiverecords configuration property temporarily for the PME table.
  • pme_set_autolink: This command sets the autolinkrecordsconfiguration property temporarily for the identified PME table.
  • pme_disable_all: This command Disables all tables in HBase that are pme_enabled.

Advanced HBase commands

Let’s take a look at some of the commands which are given below:-

Hbase Namespace Commands

A namespace is a logical grouping of tables, a group of users share access to the table but with different privileges.

There are 6 namespace commands they are:

  • Create_namespace: They are used to create a new namespace.

base(main): 019:0> create ‘namespace name:mydb’,’cf’
0 row(s) in 2.3760 seconds=>

Hbase:: Table – ‘namespacename:mydb

  • List namespace: They list the no.of rows in the namespace.
  1. Load Test Tool: They test the cluster by performing read/write.

Example: Hbase: ltt -h

  1. wal: To get a list of Wal files.

Example: hbase wal

wal <filename> [-h] [-j] [-p] [-r]

where -h output help message

-j output Json

-p Print values

-r region to filter

  1. Clean: This command removes all hbase related information from HDFS.
  • Alter Namespace: They alter the created namespace in HBase.

Example: base clean hbase(main): 046:0> alter_namespace ‘name2’, {METHOD => ‘set’, ‘PROERTY_NAME’ => ‘PROPERTY_VALUE’}

  • Describe Namespace: They describe the existing namespace in Hbase.

Example: hbase(main):047:0> describe_namespace ‘name3’
DESCRIPTION
{NAME => ' namespace name ', PROERTY_NAME => 'PROPERTY_VALUE'}

  • Hbase Snapshot:

They allow us to take a copy of a table and exporting it to another cluster. It can be stored in IBM Cloud Object storage.

Example: base org.apache.hadoop.hbase.mapreduce.Export test cos://mysql.my

  • Delete a snapshot

example: hbase shell>> delete _snapshot ‘ snapshot name’

  • View Snapshot info

example: hbase shell>> snapshot_info snapshot name

Tips and Tricks To use HBase commands

HBase has good random read and write access and preferred by Online analytical expertise. Representing the logical arrangements of a row in a base table is very important. Rows are stored as row keys. The row key can directly access any row. We can use HBase Shell (Command-line interface) to create an Hbase table, add rows to it, scans the complete table, and apply filters that filter row based on certain constraints. Some major factors to be considered while creating a table design. They are: Column families, rows, versions, read/write schemas. No data types are used in the base while creating a table design everything is stored as a byte array. No transactions are done in HBase. We can interact with HBase in two ways: either using Java API, HBase Shell. The capacity of the HBase cluster can be sustained by increasing the request handler thread count instantly.

Conclusion

HBase shell and general commands give appropriate information about different data manipulation types, table management, and cluster replication commands. Various functions can be performed using these commands on tables present in HBase. Hbase is integrated with Hive for SQL queries, and they do not have flexible schemas.HBase clusters are back up by full cluster shutdown, and on a live cluster, they do have automatic failover support.

Recommended Articles

This has been a guide to HBase Commands. Here we have discussed basic as well as advanced and some immediate HBase commands. You may also look at the following article to learn more –

  1. Important VBA Commands
  2. Tableau Commands
  3. Cheatsheet SQL (Commands, Free Tips, and Tricks)
  4. HBase Create Table | Syntax and Examples
Popular Course in this category
Hadoop Training Program (20 Courses, 14+ Projects, 4 Quizzes)
  20 Online Courses |  14 Hands-on Projects |  135+ Hours |  Verifiable Certificate of Completion
4.5
Price

View Course

Related Courses

Data Scientist Training (85 Courses, 67+ Projects)4.9
Machine Learning Training (20 Courses, 29+ Projects)4.8
MapReduce Training (2 Courses, 4+ Projects)4.7
1 Shares
Share
Tweet
Share
Primary Sidebar
Footer
About Us
  • Blog
  • Who is EDUCBA?
  • Sign Up
  • Live Classes
  • Corporate Training
  • Certificate from Top Institutions
  • Contact Us
  • Verifiable Certificate
  • Reviews
  • Terms and Conditions
  • Privacy Policy
  •  
Apps
  • iPhone & iPad
  • Android
Resources
  • Free Courses
  • Database Management
  • Machine Learning
  • All Tutorials
Certification Courses
  • All Courses
  • Data Science Course - All in One Bundle
  • Machine Learning Course
  • Hadoop Certification Training
  • Cloud Computing Training Course
  • R Programming Course
  • AWS Training Course
  • SAS Training Course

ISO 10004:2018 & ISO 9001:2015 Certified

© 2022 - EDUCBA. ALL RIGHTS RESERVED. THE CERTIFICATION NAMES ARE THE TRADEMARKS OF THEIR RESPECTIVE OWNERS.

EDUCBA
Free Data Science Course

SPSS, Data visualization with Python, Matplotlib Library, Seaborn Package

*Please provide your correct email id. Login details for this Free course will be emailed to you

By signing up, you agree to our Terms of Use and Privacy Policy.

EDUCBA Login

Forgot Password?

By signing up, you agree to our Terms of Use and Privacy Policy.

EDUCBA
Free Data Science Course

Hadoop, Data Science, Statistics & others

*Please provide your correct email id. Login details for this Free course will be emailed to you

By signing up, you agree to our Terms of Use and Privacy Policy.

EDUCBA

*Please provide your correct email id. Login details for this Free course will be emailed to you

By signing up, you agree to our Terms of Use and Privacy Policy.

Let’s Get Started

By signing up, you agree to our Terms of Use and Privacy Policy.

This website or its third-party tools use cookies, which are necessary to its functioning and required to achieve the purposes illustrated in the cookie policy. By closing this banner, scrolling this page, clicking a link or continuing to browse otherwise, you agree to our Privacy Policy

Loading . . .
Quiz
Question:

Answer:

Quiz Result
Total QuestionsCorrect AnswersWrong AnswersPercentage

Explore 1000+ varieties of Mock tests View more