1. Enter the HBase command line
>hbase Shell
Exit command line
>quit
2. Create a table
>create ' users ', ' user_id ', ' address ', ' info '
3. View All Tables
>list
4. View table Structure
>describe ' users '
5. Delete the table:
>disable ' users ' >drop ' users '
6. New Data
>put ' users ', ' Xiaowang ', ' info:age ', ' >put ' users ', ' xiaoming ', ' address:city ', ' Beijing ' >put ' users ', ' Xiaowang ', ' address:city ', ' Shagnhai '
7. Modify the Data
>put ' users ', ' xiaoming ', ' info:age ', ' 27 '
8. Get row information
>get ' users ', ' xiaoming '
9. Get column Information
>get ' users ', ' xiaoming ', ' info:age '
10. Get Column versions information (do not specify the default to save 3 versions of data when building a table)
>get ' users ', ' xiaoming ', {column= ' Info:age ', versions=>3}
11. Get data for a version of column (timestamp specifies the current timestamp for insertion)
>get ' users ', ' xiaoming ', {column= ' Info:age ', timestamp=>15134937056}
12. Full Table Scan
>scan ' users '
13. Delete Column
>delete ' users ', ' xiaoming ', ' info:age '
14. Delete Row
>deleteall ' users ', ' Xiaowang '
15. Number of rows of statistics
>count ' users '
16. Clear the table
>truncate ' users '
My personal website: http://www.caicongyang.com;
My csdn blog address: Http://blog.csdn.net/caicongyang;
Hbase Shell operations (full record)