hbase 经常使用命令

使用“hbase shell”命令来启动HBase的交互shell:./bin/hbase shellshell

退出 shell:hbase(main):021:0> exitspa

 

建立表:create 'emp', 'personal data', professional datait

list:列出全部表。io

禁用表:disable 'emp'。禁用表以后,仍然能够经过 list 和exists命令查看到。没法扫描到它存在。scan 'emp'不能够。
table

查看表是否被禁用:hbase> is_disabled 'table name'class

启用表:enable 'emp'。启用表以后,扫描( scan 'emp')。若是能看到的模式,那么证实表已成功启用。top

返回表说明:hbase> describe 'table name'tab

设置表为只读:hbase>alter 't1', READONLY(option)【alter 'emp', READONLYdi

删除列族:alter table name ’, delete => column family ’【alter 'employee','delete'=>'professional'】
文件

删除表:hbase(main):018:0> disable 'emp'        hbase(main):019:0> drop 'emp'【先禁用后删除】hbase> drop_all t.*’ 【删除匹配“regex”表】

 

要中止HBase:浏览进入到HBase主文件夹,而后用如下命令:./bin/stop-hbase.sh

相关文章
相关标签/搜索