是否有任何命令可以获得有关hbase表的完整描述,例如所有者,数据库,修改时间等。
在hive中,我可以使用
获取这些信息 desc formatted tablename
但是在hbase desc 'tablename'
中显示了size,version,replication_scope等
我想获取hbase表的所有者详细信息。
感谢。
答案 0 :(得分:1)
首先,将access control
相关配置添加到hbase-site.xml:
<property>
<name>hbase.security.authorization</name>
<value>true</value>
</property>
<property>
<name>hbase.coprocessor.master.classes</name>
<value>org.apache.hadoop.hbase.security.access.AccessController</value>
</property>
<property>
<name>hbase.coprocessor.region.classes</name>
<value>org.apache.hadoop.hbase.security.token.TokenProvider,org.apache.hadoop.hbase.security.access.AccessController</value>
</property>
您可以按照here的说明操作,也许必须在修改后重新启动hbase。
然后,设置一个表的所有者,并对其进行描述
hbase(main):007:0> alter 'MyTable', {OWNER => 'sel-fish'}
Updating all regions with the new schema...
1/1 regions updated.
Done.
0 row(s) in 1.9980 seconds
hbase(main):008:0> desc 'MyTable'
Table MyTable is ENABLED
MyTable, {TABLE_ATTRIBUTES => {METADATA => {'OWNER' => 'sel-fish'}}
COLUMN FAMILIES DESCRIPTION
{NAME => 'cf', DATA_BLOCK_ENCODING => 'NONE', BLOOMFILTER => 'ROW', REPLICATION_SCOPE => '0', COMPRESSION => 'NONE', VERSIONS => '2147483647', TTL => '500 SECONDS (8 MINUTES 20 SECO
NDS)', MIN_VERSIONS => '0', KEEP_DELETED_CELLS => 'FALSE', BLOCKSIZE => '65536', IN_MEMORY => 'false', BLOCKCACHE => 'true'}
1 row(s) in 0.0300 seconds