The document provides instructions and examples for common commands used in the HBase shell to perform operations like listing tables, creating tables, describing tables, counting rows, putting and getting values, scanning tables, and more. It also provides tips for scripting with HBase, different ways to back up and restore HBase data, and using Hive to run SQL queries on HBase tables.
SQL stands for Structured Query Language.
SQL is a database management language for relational databases.
SQL lets you access and manipulate databases.
#LibreOffice is a #free and powerful #officesuite, and a successor to #OpenOffice.org (commonly known as #OpenOffice).
Its clean interface and feature-rich tools help you unleash your #creativity and enhance your #productivity. #LibreOffice includes several applications that make it the most versatile #Free and #OpenSource office suite on the market: #Writer (#wordprocessing), Calc (#spreadsheets), Impress (presentations), #Draw (vector graphics and #flowcharts), Base (#databases), and #Math (#formula editing).
#LibreOffice is #community-driven and #developed #software, and is a project of the #nonprofit #organization, The #Document #Foundation. #LibreOffice is free and #opensource software, originally based on #OpenOffice.org (commonly known as OpenOffice), and is the most actively developed OpenOffice.org successor project.
#LibreOffice is developed by users who, just like you, believe in the principles of #FreeSoftware and in sharing their work with the world in non-restrictive ways.
This office suite can easily replace costly paid option available. If you need a good office suite which is easily and freely available you can for sure give a try and.
It has following features/components for making your work easy and cost free and vendor independent:
Writer – word processor
Calc – spreadsheet
Impress – presentations
Draw – diagrams
Base – database
Math – formula editor
Charts
Better #collaboration
#Sharingdocuments and edits with other users have been enhanced and well tracked, to make modifications more clear.
Work faster in Calc
Working with #Spreadsheet has the new #Bash-like autocompletion feature helps you to input data in a snap.
#Barcodes and borders
We can now insert #barcodes into your #documents with just a few clicks
For Full information about the release you can visit if your are interested.
https://wiki.documentfoundation.org/ReleaseNotes/7.3
If you need any help you can reach out here
https://twitter.com/libreoffice
https://blog.documentfoundation.org/
https://www.facebook.com/libreoffice.org
https://twitter.com/AskLibreOffice
What Next :
#LibreOffice 7.4 – is next major release in August, you can try installing and test it and help the developers to find if any bug or issue or need any improvement.
Let's install and explore.
We will now install it in #Ubuntu and explore this a bit
#SystemArchitecture Series: #Kerberos Architecture Component and communication flow #architecture
#Kerberos is a ticketing-based #authentication #system, based on the use of #symmetric keys. #Kerberos uses tickets to provide #authentication to resources instead of #passwords. This eliminates the threat of #password stealing via #networksniffing. One of the biggest benefits of #Kerberos is its ability to provide single sign-on (#SSO). Once you log into your #Kerberos environment, you will be automatically logged into other applications in the environment.
To help provide a secure environment, #Kerberos makes use of Mutual #Authentication. In Mutual #Authentication, both the #server and the #client must be authenticated. The client knows that the server can be trusted, and the server knows that the client can be trusted. This #authentication helps prevent man-in-the-middle attacks and #spoofing. #Kerberos is also time sensitive. The tickets in a #Kerberosenvironment must be renewed periodically or they will expire.
6. COUNT
Count the number of rows in a table.
This operation may take a LONG time (Run
'$HADOOP_HOME/bin/hadoop jar hbase.jar
rowcount' to run a counting mapreduce job).
Current count is shown every 1000 rows by default.
Count interval may be optionally specified.
Examples:
hbase> count 't1' hbase> count 't1', 100
7. DELETE
Put a delete cell value at specified table/row/column
and optionally timestamp coordinates.
Eg:
Delete ‘table’,’colfam:columnname’
8. DELETEALL
Delete all cells in a given row; pass a table name, row,
and optionally a column and timestamp
Delete ‘table’,’rowkey’
13. GET
Get row or cell contents; pass table name, row,
hbase> get 't1', 'r1'
hbase> get 't1', 'r1', {COLUMN => 'c1'}
hbase> get 't1', 'r1', {COLUMN => ['c1', 'c2', 'c3']}
hbase> get 't1', 'r1', {COLUMN => 'c1', TIMESTAMP
=> ts1}
hbase> get 't1', 'r1', {COLUMN => 'c1', TIMESTAMP
=> ts1, VERSIONS => 4}
14. PUT
Put a cell 'value' at specified table/row/column and optionally
timestamp coordinates.
To put a cell value into table 't1' at row 'r1' under column 'c1'
do:
hbase> put 't1', 'r1', 'c1', 'value'
15. SCAN
Scan a tableTo scan all members of a column family, leave the
qualifier empty as in 'col_family:'.
hbase> scan 't1’
16. STATUS
Show cluster status.
Can be 'summary', 'simple', or 'detailed'.
The default is 'summary'.
Examples:
hbase> status
hbase> status 'simple'
hbase> status 'summary'
hbase> status 'detailed'
20. ALTER
Alter column family schema; pass table name and a dictionary
specifying new column family schema. Dictionaries are
described below in the GENERAL NOTES section. Dictionary
must include name of column family to alter.
For example,
To change or add the 'f1' column family in table 't1' from defaults
to instead keep a maximum of 5 cell VERSIONS, do:
hbase> alter 't1', {NAME => 'f1', VERSIONS => 5}
To delete the 'f1' column family in table 't1', do:
hbase> alter 't1', {NAME => 'f1', METHOD => 'delete'}
22. SCRIPTING
You can pass scripts to the HBase Shell by doing the
following:
bin/hbase shell PATH_TO_SCRIPT
23. SOME HBASE TRICKS
echo "create 'user', 'info'" | hbase shell
Using this command you can create table called use
with column family name info without entering to the
hbase shell.
for i in '0'..'4' do
put "user", "user_#{i}", "info:email",
"user_#{i}@hakunamapdata.com"
End
This will create 4 users with user#1 to 4 and put email
address too
24. SCRIPT FOR HBASE
cat hbase_user_part_scan.txt scan 'user',
{STARTROW => 'user_1', STOPROW => 'user_3'}
exit
$ hbase shell hbase_user_part_scan.txt
This script will scan the user table and give output.
26. SEE WHEN A RECORD WAS ADDED
get 'user', 'user_1‘
Time.at(1344763701019/1000)
Will show you the human understable time like
Sun Aug 12 11:28:21 +0200 2012
27. SCHEMA DESIGN
We can take advantage of table schema and store all
information realated to a given user in one row (but
in two separate column families: info and friend).
Last but not least, the rowkey can be simply the
user’s unique username.It leads us to the following
table schema:
Just visit this link for understanding more on schema
designing :
http://www.slideshare.net/hmisty/20090713-hbase-
schema-design-case-studies
28. ADDING MORE DATA TO HBASE TABLES
$ hbase shell
hbase(main):001:0> create 'user', 'info', 'friend'
hbase(main):002:0> put 'user', 'username1', 'friend:username2',
'childhood'
hbase(main):003:0> put 'user', 'username1', 'friend:username3',
'childhood'
hbase(main):004:0> put 'user', 'username2', 'friend:username3',
'childhood'
hbase(main):005:0> put 'user', 'username2', 'friend:username4',
'childhood'
hbase(main):006:0> put 'user', 'username3', 'friend:username5',
'childhood'
hbase(main):007:0> put 'user', 'username1', 'friend:username5',
'childhood‘
Or you can write an script to create these value
29. SPECIFYING DIFFERENT CONFIGURATION FOR HBASE SHELL
HBase Shell is started by using the hbase shell
command. This command uses the HBase
configuration file (hbase-site.xml) for the client to
find the cluster to connect to. After connecting to the
cluster, it starts a prompt, waiting for commands. As
shown in the following code, you can also use the --
config option, which allows you to pass a different
configuration for HBase Shell to use:
hbase --config <configuration_directory> shell
30. SOME HELPFUL COMMANDS : EXERCISE
Get a specified row by using the get command:
Delete a specified cell by using the delete command:
Delete all the cells in a given row using the deleteall
command:
enable the balancer
33. YOU WANT TO QUERY HBASE USING SQL????
Use hive to query . For that you need to create a table in hive as
external table to hbase as follows:
create external table hbase_tablehbase
(key string, v01 string, v02 string, v03 string)
stored by 'org.apache.hadoop.hive.hbase.HBaseStorageHandler'
with serdeproperties ("hbase.columns.mapping" =
":key,n:v01,n:v02,n:v03")
tblproperties("hbase.table.name" = "tablehbase");
select * from hbase_hly_temp where v01='808C';
You can give this query in hive to get data from hbase and you
have lot of other options with hive just visit :
http://karmasphere.com/hive-queries-on-table-data
34. BACKING UP AND RESTORING HBASE DATA
• Full shutdown backup using distcp
• Using CopyTable to copy data from one table to
another
• Exporting an HBase table to dump files on HDFS
• Restoring HBase data by importing dump files from
HDFS
• Backing up NameNode metadata
• Backing up region starting keys
• Cluster replication