SlideShare a Scribd company logo
Steps to restart hdfs
======================
sudo service hadoop-master stop;
sudo service hadoop-master start;
hadoop dfsadmin -safemode leave;
sudo jps
Steps to restart hbase
======================
* kill hmaster,regionserver and zookeeper
* rm -Rf /usr/lib/hbase-1.1.2/logs/*
* /usr/lib/hbase-1.1.2/bin/start-hbase.sh
* hbase shell
********************************************************************************
*****************************************************
General Commands
********************************************************************************
*****************************************************
status:
======
Provides the status of HBase, for example, the number of servers.
Ex:
--
status
--------------------------------------------------------------------------------
----------------------------------------------------
version:
=======
Provides the version of HBase being used.
Ex:
--
version
--------------------------------------------------------------------------------
----------------------------------------------------
table_help:
==========
Provides help for table-reference commands.
Ex:
--
table_help
--------------------------------------------------------------------------------
----------------------------------------------------
whoami:
======
Provides information about the user.
Ex:
--
whoami
********************************************************************************
*****************************************************
Data Definition Language
********************************************************************************
*****************************************************
CREATE TABLE
============
Creates a table.
Syntax
------
create '<table name>','<column family>'
Ex
--
create 'emp', 'personal data', 'professional data'
Verification
------------
list
--------------------------------------------------------------------------------
----------------------------------------------------
LISTING TABLES
==============
Lists all the tables in HBase.
Syntax
------
list
Ex
list
--------------------------------------------------------------------------------
----------------------------------------------------
DISABLING A TABLE
=================
Disables a table.
Syntax
------
disable 'table name'
disable_all 'regex'
Ex
--
disable 'emp'
disable_all 'e.*'
Verification
------------
is_disabled 'emp'
scan 'emp'
--------------------------------------------------------------------------------
----------------------------------------------------
ENABLING A TABLE
================
Enables a table.
Syntax
------
enable 'table name'
enable_all 'regex'
Ex
--
enable 'emp'
enable_all 'e.*'
Verification
------------
is_enabled 'emp'
scan 'emp'
--------------------------------------------------------------------------------
----------------------------------------------------
DESCRIBE
========
Provides the description of a table.
Syntax
------
describe 'table name'
Ex
--
describe 'emp'
--------------------------------------------------------------------------------
----------------------------------------------------
ALTER
=====
Changing the Maximum Number of Cells of a Column Family
syntax
------
alter 't1', NAME => 'f1', VERSIONS => 5
Ex
--
alter 'emp', NAME => 'personal data', VERSIONS => 5
Verification
------------
describe 'emp'
--------------------------------------------------------------------------------
-----------------------------------------------------
Table Scope Operators
=====================
MAX_FILESIZE,
READONLY,
MEMSTORE_FLUSHSIZE,
DEFERRED_LOG_FLUSH
--------------------------------------------------------------------------------
-----------------------------------------------------
ALTER
=====
Table Scope Operators - Setting Read Only
syntax
------
alter 't1', READONLY(option)
Ex
--
alter 'emp', READONLY
Verification
------------
describe 'emp'
--------------------------------------------------------------------------------
-----------------------------------------------------
ALTER
=====
Table Scope Operators - Removing Table Scope Operators
syntax
------
alter 't1', METHOD => 'table_att_unset', NAME => 'MAX_FILESIZE'
Ex
--
alter 'emp', METHOD => 'table_att_unset', NAME => 'MAX_FILESIZE'
--------------------------------------------------------------------------------
-----------------------------------------------------
ALTER
=====
Deleting a Column Family
syntax
------
alter ' table name ', 'delete' => 'column family '
Ex
--
alter 'emp','delete'=>'professional data'
Verification
------------
describe 'emp'
--------------------------------------------------------------------------------
----------------------------------------------------
EXISTS
======
Verifies whether a table exists.
syntax
------
exists 'table name'
Ex
--
exists 'emp'
--------------------------------------------------------------------------------
----------------------------------------------------
DROP A TABLE
============
Drops a table from HBase.
syntax
------
drop 'table name'
drop_all 'regex'
Ex
--
disable 'emp'
drop 'emp'
disable_all 'e.*'
drop_all 'e.*'
Verification
------------
exists 'emp'
list
--------------------------------------------------------------------------------
----------------------------------------------------
TRUNCATE:
========
Disables, drops, and recreates a specified table.
Syntax
------
truncate 'table name'
Ex
--
truncate 'emp'
Verification
------------
scan 'emp'
--------------------------------------------------------------------------------
----------------------------------------------------
SHUTTING DOWN HBASE
===================
* exit the shell
Ex
--
exit
* Stopping HBase
Ex
--
./bin/stop-hbase.sh
********************************************************************************
*****************************************************
Data Manipulation Language
********************************************************************************
*****************************************************
CREATE DATA
===========
Puts a cell value at a specified column in a specified row in a particular
table.
Syntax
------
put '<table name>','row1','<colfamily:colname>','<value>'
Ex
--
put 'emp','1','personal data:name','raju'
put 'emp','1','personal data:city','hyderabad'
put 'emp','1','professional data:designation','manager'
put 'emp','1','professional data:salary','50000'
Verification
------------
scan 'emp'
--------------------------------------------------------------------------------
----------------------------------------------------
UPDATE DATA
===========
update an existing cell value using the put command
Syntax
------
put 'table name','row ','Column family:column name','new value'
Ex
--
put 'emp','1','personal data:city','Delhi'
Verification
------------
scan 'emp'
--------------------------------------------------------------------------------
----------------------------------------------------
READ DATA
=========
read a cell value using the get command
Syntax
------
get '<table name>','row1'
get 'table name', 'rowid', {COLUMN => 'column family:column name '}
Ex
--
get 'emp', '1'
get 'emp', '1', {COLUMN=>'personal data:name'}
--------------------------------------------------------------------------------
----------------------------------------------------
DELETE DATA
===========
Deletes in a table.
Syntax
------
delete '<table name>', '<row>', '<column name >', '<time stamp>'
deleteall '<table name>','<row>'
Ex
--
delete 'emp', '1', 'personal data:city', 1417521848375
deleteall 'emp','1'
Verification
------------
scan 'emp'
--------------------------------------------------------------------------------
----------------------------------------------------
HBASE SCAN
==========
Scans and returns the table data.
Syntax
------
scan '<table name>'
Ex
--
scan 'emp'
--------------------------------------------------------------------------------
----------------------------------------------------
COUNT
=====
Counts and returns the number of rows in a table.
Syntax
------
count '<table name>'
Ex
--
count 'emp'
********************************************************************************
*****************************************************
HBASE SECURITY
********************************************************************************
*****************************************************
GRANT
=====
grant permissions to users in HBase
Syntax
------
grant <user> <permissions> [<table> [<column family> [<column qualifier>]]
R - represents read privilege.
W - represents write privilege.
X - represents execute privilege.
C - represents create privilege.
A - represents admin privilege.Ex
Ex
--
grant 'Tutorialspoint', 'RWXCA'
--------------------------------------------------------------------------------
----------------------------------------------------
REVOKE
======
used to revoke a user's access rights of a table
Syntax
------
revoke <user>
Ex
--
revoke 'Tutorialspoint'
--------------------------------------------------------------------------------
----------------------------------------------------
USER_PERMISSION
===============
list all the permissions for a particular table
Syntax
------
user_permission 'tablename'
Ex
--
user_permission 'emp'

More Related Content

What's hot

11 Things About 11gr2
11 Things About 11gr211 Things About 11gr2
11 Things About 11gr2
afa reg
 
Oracle 12c far sync standby instance
Oracle 12c far sync standby instanceOracle 12c far sync standby instance
Oracle 12c far sync standby instance
Monowar Mukul
 
Seistech SQL code
Seistech SQL codeSeistech SQL code
Seistech SQL code
Simon Hoyle
 

What's hot (20)

pg_proctab: Accessing System Stats in PostgreSQL
pg_proctab: Accessing System Stats in PostgreSQLpg_proctab: Accessing System Stats in PostgreSQL
pg_proctab: Accessing System Stats in PostgreSQL
 
PostgreSQL Portland Performance Practice Project - Database Test 2 Tuning
PostgreSQL Portland Performance Practice Project - Database Test 2 TuningPostgreSQL Portland Performance Practice Project - Database Test 2 Tuning
PostgreSQL Portland Performance Practice Project - Database Test 2 Tuning
 
Tibero sql execution plan guide en
Tibero sql execution plan guide enTibero sql execution plan guide en
Tibero sql execution plan guide en
 
Top 10 Mistakes When Migrating From Oracle to PostgreSQL
Top 10 Mistakes When Migrating From Oracle to PostgreSQLTop 10 Mistakes When Migrating From Oracle to PostgreSQL
Top 10 Mistakes When Migrating From Oracle to PostgreSQL
 
Db health check
Db health checkDb health check
Db health check
 
11 Things About 11gr2
11 Things About 11gr211 Things About 11gr2
11 Things About 11gr2
 
PostgreSQL Procedural Languages: Tips, Tricks and Gotchas
PostgreSQL Procedural Languages: Tips, Tricks and GotchasPostgreSQL Procedural Languages: Tips, Tricks and Gotchas
PostgreSQL Procedural Languages: Tips, Tricks and Gotchas
 
Oracle 12c far sync standby instance
Oracle 12c far sync standby instanceOracle 12c far sync standby instance
Oracle 12c far sync standby instance
 
pg_proctab: Accessing System Stats in PostgreSQL
pg_proctab: Accessing System Stats in PostgreSQLpg_proctab: Accessing System Stats in PostgreSQL
pg_proctab: Accessing System Stats in PostgreSQL
 
How to create a pluggable database by cloning an existing local pdb
How to create a pluggable database by cloning an existing local pdbHow to create a pluggable database by cloning an existing local pdb
How to create a pluggable database by cloning an existing local pdb
 
11 things about 11gr2
11 things about 11gr211 things about 11gr2
11 things about 11gr2
 
Hadoop Performance comparison
Hadoop Performance comparisonHadoop Performance comparison
Hadoop Performance comparison
 
حل اسئلة الكتاب السعودى فى شرح قواعد البيانات اوراكل
حل اسئلة الكتاب السعودى فى شرح قواعد البيانات اوراكلحل اسئلة الكتاب السعودى فى شرح قواعد البيانات اوراكل
حل اسئلة الكتاب السعودى فى شرح قواعد البيانات اوراكل
 
Optimizer Cost Model MySQL 5.7
Optimizer Cost Model MySQL 5.7Optimizer Cost Model MySQL 5.7
Optimizer Cost Model MySQL 5.7
 
Free toolsinstall
Free toolsinstallFree toolsinstall
Free toolsinstall
 
SCALE 15x Minimizing PostgreSQL Major Version Upgrade Downtime
SCALE 15x Minimizing PostgreSQL Major Version Upgrade DowntimeSCALE 15x Minimizing PostgreSQL Major Version Upgrade Downtime
SCALE 15x Minimizing PostgreSQL Major Version Upgrade Downtime
 
Congfigure python as_ide
Congfigure python as_ideCongfigure python as_ide
Congfigure python as_ide
 
Oracle12c For Developers
Oracle12c For DevelopersOracle12c For Developers
Oracle12c For Developers
 
XPDS14 - osstest, Xen's Automatic Testing Facility - Ian Jackson, Citrix
XPDS14 - osstest, Xen's Automatic Testing Facility - Ian Jackson, CitrixXPDS14 - osstest, Xen's Automatic Testing Facility - Ian Jackson, Citrix
XPDS14 - osstest, Xen's Automatic Testing Facility - Ian Jackson, Citrix
 
Seistech SQL code
Seistech SQL codeSeistech SQL code
Seistech SQL code
 

Viewers also liked

Stats from twitter
Stats from twitterStats from twitter
Stats from twitter
Lydia Hatton
 

Viewers also liked (17)

Real time Analytics with Apache Kafka and Apache Spark
Real time Analytics with Apache Kafka and Apache SparkReal time Analytics with Apache Kafka and Apache Spark
Real time Analytics with Apache Kafka and Apache Spark
 
Zakir_Hussain_cv
Zakir_Hussain_cvZakir_Hussain_cv
Zakir_Hussain_cv
 
Главное - жить любя
Главное - жить любяГлавное - жить любя
Главное - жить любя
 
16. Дзяржаўнасць усходніх славян
16. Дзяржаўнасць усходніх славян16. Дзяржаўнасць усходніх славян
16. Дзяржаўнасць усходніх славян
 
Stats from twitter
Stats from twitterStats from twitter
Stats from twitter
 
Marketing communication specialist performance appraisal
Marketing communication specialist performance appraisalMarketing communication specialist performance appraisal
Marketing communication specialist performance appraisal
 
Battery Analyser
Battery AnalyserBattery Analyser
Battery Analyser
 
Home Office Storage Units
Home Office Storage UnitsHome Office Storage Units
Home Office Storage Units
 
Dit gesprek kan worden opgenomen voor trainingsdoeleinden
Dit gesprek kan worden opgenomen voor trainingsdoeleindenDit gesprek kan worden opgenomen voor trainingsdoeleinden
Dit gesprek kan worden opgenomen voor trainingsdoeleinden
 
12. На шляху да дзяржавы
12. На шляху да дзяржавы12. На шляху да дзяржавы
12. На шляху да дзяржавы
 
Admis23 pem princ-2017-min
Admis23 pem princ-2017-minAdmis23 pem princ-2017-min
Admis23 pem princ-2017-min
 
Cuestionario 1 b
Cuestionario 1 bCuestionario 1 b
Cuestionario 1 b
 
Stop Shopping Cart Abandonment
Stop Shopping Cart AbandonmentStop Shopping Cart Abandonment
Stop Shopping Cart Abandonment
 
Curry deanna ppp_slideshow
Curry deanna ppp_slideshowCurry deanna ppp_slideshow
Curry deanna ppp_slideshow
 
كارفور
كارفوركارفور
كارفور
 
Manejo de-powerpoint
Manejo de-powerpointManejo de-powerpoint
Manejo de-powerpoint
 
Ljnhljnh
LjnhljnhLjnhljnh
Ljnhljnh
 

Similar to Quick reference for HBase shell commands

Mha procedure
Mha procedureMha procedure
Mha procedure
Louis liu
 
php drupal mysql MAMP
php drupal mysql MAMPphp drupal mysql MAMP
php drupal mysql MAMP
Jing Cheng
 

Similar to Quick reference for HBase shell commands (20)

Apache Hadoop Shell Rewrite
Apache Hadoop Shell RewriteApache Hadoop Shell Rewrite
Apache Hadoop Shell Rewrite
 
C99
C99C99
C99
 
C99
C99C99
C99
 
Dtalk shell
Dtalk shellDtalk shell
Dtalk shell
 
Network Automation: Ansible 102
Network Automation: Ansible 102Network Automation: Ansible 102
Network Automation: Ansible 102
 
Xen server 6.0 xe command reference (1.1)
Xen server 6.0 xe command reference (1.1)Xen server 6.0 xe command reference (1.1)
Xen server 6.0 xe command reference (1.1)
 
Advanced Shell Scripting
Advanced Shell ScriptingAdvanced Shell Scripting
Advanced Shell Scripting
 
Samba 4 - debian instalacao
Samba 4 - debian instalacaoSamba 4 - debian instalacao
Samba 4 - debian instalacao
 
Diseqc
DiseqcDiseqc
Diseqc
 
Command
CommandCommand
Command
 
Linea de comandos bioface zem800
Linea de comandos bioface zem800Linea de comandos bioface zem800
Linea de comandos bioface zem800
 
Vagrant, Ansible, and OpenStack on your laptop
Vagrant, Ansible, and OpenStack on your laptopVagrant, Ansible, and OpenStack on your laptop
Vagrant, Ansible, and OpenStack on your laptop
 
Step by step migration ufs to zfs file system on solaris 10
Step by step migration ufs to zfs file system on solaris 10Step by step migration ufs to zfs file system on solaris 10
Step by step migration ufs to zfs file system on solaris 10
 
Puppet @ Seat
Puppet @ SeatPuppet @ Seat
Puppet @ Seat
 
Yapc::NA::2009 - Command Line Perl
Yapc::NA::2009 - Command Line PerlYapc::NA::2009 - Command Line Perl
Yapc::NA::2009 - Command Line Perl
 
Mha procedure
Mha procedureMha procedure
Mha procedure
 
php drupal mysql MAMP
php drupal mysql MAMPphp drupal mysql MAMP
php drupal mysql MAMP
 
Bash Shell Introduction By Arun Bagul
Bash Shell Introduction  By Arun BagulBash Shell Introduction  By Arun Bagul
Bash Shell Introduction By Arun Bagul
 
BSDM with BASH: Command Interpolation
BSDM with BASH: Command InterpolationBSDM with BASH: Command Interpolation
BSDM with BASH: Command Interpolation
 
Simple Ways To Be A Better Programmer (OSCON 2007)
Simple Ways To Be A Better Programmer (OSCON 2007)Simple Ways To Be A Better Programmer (OSCON 2007)
Simple Ways To Be A Better Programmer (OSCON 2007)
 

Recently uploaded

Accounting and finance exit exam 2016 E.C.pdf
Accounting and finance exit exam 2016 E.C.pdfAccounting and finance exit exam 2016 E.C.pdf
Accounting and finance exit exam 2016 E.C.pdf
YibeltalNibretu
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
joachimlavalley1
 
Industrial Training Report- AKTU Industrial Training Report
Industrial Training Report- AKTU Industrial Training ReportIndustrial Training Report- AKTU Industrial Training Report
Industrial Training Report- AKTU Industrial Training Report
Avinash Rai
 

Recently uploaded (20)

Application of Matrices in real life. Presentation on application of matrices
Application of Matrices in real life. Presentation on application of matricesApplication of Matrices in real life. Presentation on application of matrices
Application of Matrices in real life. Presentation on application of matrices
 
Forest and Wildlife Resources Class 10 Free Study Material PDF
Forest and Wildlife Resources Class 10 Free Study Material PDFForest and Wildlife Resources Class 10 Free Study Material PDF
Forest and Wildlife Resources Class 10 Free Study Material PDF
 
Accounting and finance exit exam 2016 E.C.pdf
Accounting and finance exit exam 2016 E.C.pdfAccounting and finance exit exam 2016 E.C.pdf
Accounting and finance exit exam 2016 E.C.pdf
 
[GDSC YCCE] Build with AI Online Presentation
[GDSC YCCE] Build with AI Online Presentation[GDSC YCCE] Build with AI Online Presentation
[GDSC YCCE] Build with AI Online Presentation
 
Basic_QTL_Marker-assisted_Selection_Sourabh.ppt
Basic_QTL_Marker-assisted_Selection_Sourabh.pptBasic_QTL_Marker-assisted_Selection_Sourabh.ppt
Basic_QTL_Marker-assisted_Selection_Sourabh.ppt
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
Matatag-Curriculum and the 21st Century Skills Presentation.pptx
Matatag-Curriculum and the 21st Century Skills Presentation.pptxMatatag-Curriculum and the 21st Century Skills Presentation.pptx
Matatag-Curriculum and the 21st Century Skills Presentation.pptx
 
Ethnobotany and Ethnopharmacology ......
Ethnobotany and Ethnopharmacology ......Ethnobotany and Ethnopharmacology ......
Ethnobotany and Ethnopharmacology ......
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
 
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
 
Basic Civil Engineering Notes of Chapter-6, Topic- Ecosystem, Biodiversity G...
Basic Civil Engineering Notes of Chapter-6,  Topic- Ecosystem, Biodiversity G...Basic Civil Engineering Notes of Chapter-6,  Topic- Ecosystem, Biodiversity G...
Basic Civil Engineering Notes of Chapter-6, Topic- Ecosystem, Biodiversity G...
 
How to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERPHow to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERP
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
 
Solid waste management & Types of Basic civil Engineering notes by DJ Sir.pptx
Solid waste management & Types of Basic civil Engineering notes by DJ Sir.pptxSolid waste management & Types of Basic civil Engineering notes by DJ Sir.pptx
Solid waste management & Types of Basic civil Engineering notes by DJ Sir.pptx
 
The Benefits and Challenges of Open Educational Resources
The Benefits and Challenges of Open Educational ResourcesThe Benefits and Challenges of Open Educational Resources
The Benefits and Challenges of Open Educational Resources
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
 
Jose-Rizal-and-Philippine-Nationalism-National-Symbol-2.pptx
Jose-Rizal-and-Philippine-Nationalism-National-Symbol-2.pptxJose-Rizal-and-Philippine-Nationalism-National-Symbol-2.pptx
Jose-Rizal-and-Philippine-Nationalism-National-Symbol-2.pptx
 
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptxMARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
 
Industrial Training Report- AKTU Industrial Training Report
Industrial Training Report- AKTU Industrial Training ReportIndustrial Training Report- AKTU Industrial Training Report
Industrial Training Report- AKTU Industrial Training Report
 
NLC-2024-Orientation-for-RO-SDO (1).pptx
NLC-2024-Orientation-for-RO-SDO (1).pptxNLC-2024-Orientation-for-RO-SDO (1).pptx
NLC-2024-Orientation-for-RO-SDO (1).pptx
 

Quick reference for HBase shell commands

  • 1. Steps to restart hdfs ====================== sudo service hadoop-master stop; sudo service hadoop-master start; hadoop dfsadmin -safemode leave; sudo jps Steps to restart hbase ====================== * kill hmaster,regionserver and zookeeper * rm -Rf /usr/lib/hbase-1.1.2/logs/* * /usr/lib/hbase-1.1.2/bin/start-hbase.sh * hbase shell ******************************************************************************** ***************************************************** General Commands ******************************************************************************** ***************************************************** status: ====== Provides the status of HBase, for example, the number of servers. Ex: -- status -------------------------------------------------------------------------------- ---------------------------------------------------- version: ======= Provides the version of HBase being used. Ex: -- version -------------------------------------------------------------------------------- ---------------------------------------------------- table_help: ========== Provides help for table-reference commands. Ex: -- table_help -------------------------------------------------------------------------------- ---------------------------------------------------- whoami: ====== Provides information about the user. Ex: -- whoami ******************************************************************************** ***************************************************** Data Definition Language ******************************************************************************** ***************************************************** CREATE TABLE ============ Creates a table. Syntax ------ create '<table name>','<column family>'
  • 2. Ex -- create 'emp', 'personal data', 'professional data' Verification ------------ list -------------------------------------------------------------------------------- ---------------------------------------------------- LISTING TABLES ============== Lists all the tables in HBase. Syntax ------ list Ex list -------------------------------------------------------------------------------- ---------------------------------------------------- DISABLING A TABLE ================= Disables a table. Syntax ------ disable 'table name' disable_all 'regex' Ex -- disable 'emp' disable_all 'e.*' Verification ------------ is_disabled 'emp' scan 'emp' -------------------------------------------------------------------------------- ---------------------------------------------------- ENABLING A TABLE ================ Enables a table. Syntax ------ enable 'table name' enable_all 'regex' Ex -- enable 'emp' enable_all 'e.*' Verification ------------ is_enabled 'emp' scan 'emp' -------------------------------------------------------------------------------- ---------------------------------------------------- DESCRIBE ========
  • 3. Provides the description of a table. Syntax ------ describe 'table name' Ex -- describe 'emp' -------------------------------------------------------------------------------- ---------------------------------------------------- ALTER ===== Changing the Maximum Number of Cells of a Column Family syntax ------ alter 't1', NAME => 'f1', VERSIONS => 5 Ex -- alter 'emp', NAME => 'personal data', VERSIONS => 5 Verification ------------ describe 'emp' -------------------------------------------------------------------------------- ----------------------------------------------------- Table Scope Operators ===================== MAX_FILESIZE, READONLY, MEMSTORE_FLUSHSIZE, DEFERRED_LOG_FLUSH -------------------------------------------------------------------------------- ----------------------------------------------------- ALTER ===== Table Scope Operators - Setting Read Only syntax ------ alter 't1', READONLY(option) Ex -- alter 'emp', READONLY Verification ------------ describe 'emp' -------------------------------------------------------------------------------- ----------------------------------------------------- ALTER ===== Table Scope Operators - Removing Table Scope Operators syntax ------ alter 't1', METHOD => 'table_att_unset', NAME => 'MAX_FILESIZE' Ex -- alter 'emp', METHOD => 'table_att_unset', NAME => 'MAX_FILESIZE'
  • 4. -------------------------------------------------------------------------------- ----------------------------------------------------- ALTER ===== Deleting a Column Family syntax ------ alter ' table name ', 'delete' => 'column family ' Ex -- alter 'emp','delete'=>'professional data' Verification ------------ describe 'emp' -------------------------------------------------------------------------------- ---------------------------------------------------- EXISTS ====== Verifies whether a table exists. syntax ------ exists 'table name' Ex -- exists 'emp' -------------------------------------------------------------------------------- ---------------------------------------------------- DROP A TABLE ============ Drops a table from HBase. syntax ------ drop 'table name' drop_all 'regex' Ex -- disable 'emp' drop 'emp' disable_all 'e.*' drop_all 'e.*' Verification ------------ exists 'emp' list -------------------------------------------------------------------------------- ---------------------------------------------------- TRUNCATE: ======== Disables, drops, and recreates a specified table. Syntax ------ truncate 'table name' Ex
  • 5. -- truncate 'emp' Verification ------------ scan 'emp' -------------------------------------------------------------------------------- ---------------------------------------------------- SHUTTING DOWN HBASE =================== * exit the shell Ex -- exit * Stopping HBase Ex -- ./bin/stop-hbase.sh ******************************************************************************** ***************************************************** Data Manipulation Language ******************************************************************************** ***************************************************** CREATE DATA =========== Puts a cell value at a specified column in a specified row in a particular table. Syntax ------ put '<table name>','row1','<colfamily:colname>','<value>' Ex -- put 'emp','1','personal data:name','raju' put 'emp','1','personal data:city','hyderabad' put 'emp','1','professional data:designation','manager' put 'emp','1','professional data:salary','50000' Verification ------------ scan 'emp' -------------------------------------------------------------------------------- ---------------------------------------------------- UPDATE DATA =========== update an existing cell value using the put command Syntax ------ put 'table name','row ','Column family:column name','new value' Ex -- put 'emp','1','personal data:city','Delhi' Verification ------------ scan 'emp' -------------------------------------------------------------------------------- ----------------------------------------------------
  • 6. READ DATA ========= read a cell value using the get command Syntax ------ get '<table name>','row1' get 'table name', 'rowid', {COLUMN => 'column family:column name '} Ex -- get 'emp', '1' get 'emp', '1', {COLUMN=>'personal data:name'} -------------------------------------------------------------------------------- ---------------------------------------------------- DELETE DATA =========== Deletes in a table. Syntax ------ delete '<table name>', '<row>', '<column name >', '<time stamp>' deleteall '<table name>','<row>' Ex -- delete 'emp', '1', 'personal data:city', 1417521848375 deleteall 'emp','1' Verification ------------ scan 'emp' -------------------------------------------------------------------------------- ---------------------------------------------------- HBASE SCAN ========== Scans and returns the table data. Syntax ------ scan '<table name>' Ex -- scan 'emp' -------------------------------------------------------------------------------- ---------------------------------------------------- COUNT ===== Counts and returns the number of rows in a table. Syntax ------ count '<table name>' Ex -- count 'emp' ******************************************************************************** ***************************************************** HBASE SECURITY ******************************************************************************** ***************************************************** GRANT
  • 7. ===== grant permissions to users in HBase Syntax ------ grant <user> <permissions> [<table> [<column family> [<column qualifier>]] R - represents read privilege. W - represents write privilege. X - represents execute privilege. C - represents create privilege. A - represents admin privilege.Ex Ex -- grant 'Tutorialspoint', 'RWXCA' -------------------------------------------------------------------------------- ---------------------------------------------------- REVOKE ====== used to revoke a user's access rights of a table Syntax ------ revoke <user> Ex -- revoke 'Tutorialspoint' -------------------------------------------------------------------------------- ---------------------------------------------------- USER_PERMISSION =============== list all the permissions for a particular table Syntax ------ user_permission 'tablename' Ex -- user_permission 'emp'