Support Questions
Find answers, ask questions, and share your expertise

How to create Namespace in hbase?

Need steps for creation of the Namespace.

1 ACCEPTED SOLUTION

Super 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

Super 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'}

Thanks Sunile for the information.

Thanks for the information Sunile

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'

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'

Cloudera Employee

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

; ;