Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

How to create Namespace in hbase?

avatar
Contributor

Need steps for creation of the Namespace.

1 ACCEPTED SOLUTION

avatar
Master Guru

@Rammohan Reddy This is documented here

http://hbase.apache.org/book.html#_namespace

Just go to hbase shell and execute command.

21.1. Namespace management

A namespace can be created, removed or altered. Namespace membership is determined during table creation by specifying a fully-qualified table name of the form:

<code><table namespace>:<table qualifier>

Example 12. Examples

<code>#Create a namespace
create_namespace 'my_ns'
<code>#create my_table in my_ns namespace
create 'my_ns:my_table', 'fam'
<code>#drop namespace
drop_namespace 'my_ns'
<code>#alter namespace
alter_namespace 'my_ns', {METHOD => 'set', 'PROPERTY_NAME' => 'PROPERTY_VALUE'}

View solution in original post

6 REPLIES 6

avatar
Master Guru

@Rammohan Reddy This is documented here

http://hbase.apache.org/book.html#_namespace

Just go to hbase shell and execute command.

21.1. Namespace management

A namespace can be created, removed or altered. Namespace membership is determined during table creation by specifying a fully-qualified table name of the form:

<code><table namespace>:<table qualifier>

Example 12. Examples

<code>#Create a namespace
create_namespace 'my_ns'
<code>#create my_table in my_ns namespace
create 'my_ns:my_table', 'fam'
<code>#drop namespace
drop_namespace 'my_ns'
<code>#alter namespace
alter_namespace 'my_ns', {METHOD => 'set', 'PROPERTY_NAME' => 'PROPERTY_VALUE'}

avatar
Contributor

Thanks Sunile for the information.

avatar
Contributor

Thanks for the information Sunile

avatar

As a quick follow-up to @Sunile Manjee's perfect answer, check out https://martin.atlassian.net/wiki/x/0zToBQ for how to grant DBA-level privileges to these new namespaces. Heck, here it is in from the shell's perspective.

grant 'the_username', 'RWXC', '@my_ns'

avatar
Guru

Hi,

although @Lester Martin and @Sunile Manjee answered perfectly, just a minor addition. If you want to assign privileges to a _group_ instead of single user, then also use '@'-prefix, like e.g.:

grant '@admingroup', 'RWXC', '@my_ns'

avatar
Expert Contributor

Will it be possible to create namespace on the custom hdfs path ?