Hadoop HBase

Z MetaCentrum
Skočit na navigaci Skočit na vyhledávání

(Česká verze)


Namespaces

Every table must be created within the namespace of a user, e.g.:

create 'USER:TABLE', 'CF'

Creating empty tables is possible even without a namespace or in someone's else namespace, but the table will lack needed permissions.

How to connect

Shell

On a frontend type (switch USER for your username)

hbase shell

create 'USER:test', 'cf'
put 'USER:test', 'row1', 'cf:a', 'value1'
put 'USER:test', 'row2', 'cf:a', 'value2'
put 'USER:test', 'row3', 'cf:a', 'value3'
put 'USER:test', 'row4', 'cf:a', {'a'=>1, 'b'=>2}
scan 'USER:test'
get 'USER:test', 'row1'

describe 'USER:test'

disable 'USER:test'
drop 'USER:test'

Permissions

Give all permissions to user 'user_2' for table 'my_table' (where $USER is your username):

echo "grant 'user2', 'RWXCA', '$USER:my_table'" | hbase shell

Allow 'user_2' to read all tables owned by $USER:

echo "grant 'user2', 'R', '@$USER'" | hbase shell