Apache HBase is an open source, non-relational, distributed
database modeled after Google's BigTable and is written in Java. It is
developed as part of Apache Software Foundation's Apache Hadoop project
and runs on top of HDFS (Hadoop Distributed File System), providing
BigTable-like capabilities for Hadoop. That is, it provides a
fault-tolerant way of storing large quantities of sparse data (small
amounts of information caught within a large collection of empty or
unimportant data, such as finding the 50 largest items in a group of 2
billion records, or finding the non-zero items representing less than
0.1% of a huge collection).
Pre Requirements
1) A machine with Ubuntu 14.04 LTS operating system.
2) Apache Hadoop pre installed (How to install Hadoop on Ubuntu 14.04)
3) Apache HBase pre installed (How to install HBase on Ubuntu 14.04)
HBase Create, Retreive, Update, Delete (CRUD) operation
Step 1 - Change the directory to /usr/local/hbase
Step 2 - To start up the initial HBase cluster.
Creating Table
Inserting Data into Table
View or Scan
Update
Verify or Scan
Retrieve
Delete
View or Scan
Count and Truncate
Grant, revoke and list all permissions
Pre Requirements
1) A machine with Ubuntu 14.04 LTS operating system.
2) Apache Hadoop pre installed (How to install Hadoop on Ubuntu 14.04)
3) Apache HBase pre installed (How to install HBase on Ubuntu 14.04)
HBase Create, Retreive, Update, Delete (CRUD) operation
Step 1 - Change the directory to /usr/local/hbase
$ cd /usr/local/hbase
$ ./start-hbase.sh
hbase> create 'emp','personal data','professional data'
hbase> put 'emp','1','personal data:name','raju' hbase> put 'emp','1','personal data:city','hyderabad' hbase> put 'emp','1','professional data:designation','manager' hbase> put 'emp','1','professional data:salary','50000'
View or Scan
hbase> scan 'emp'
hbase> put 'emp','1','personal data:city','Delhi'
hbase> scan 'emp'
hbase> get 'emp', '1' hbase> get 'emp', '1', {COLUMN=>'personal data:name'}
hbase> delete 'emp', '1', 'personal data:city'
hbase> deleteall 'emp','1'
hbase> scan 'emp'
hbase> count 'emp' hbase> truncate 'emp' hbase> scan 'emp'
hbase> grant 'praveen', 'RWXCA' hbase> revoke 'praveen' hbase> user_permission 'emp'
Comments
Post a Comment