名称 | 命令表达式 |
查看有哪些表 | list |
获得表的描述 | describe '$tablename' |
更改表定义 | alter '$tablename'… |
创建表 | create '$tablename', '$col1','$col2','$coln' |
添加记录 | put '$tablename', '$rowkey', '$col:', '$value' |
更新记录 | 就是添加记录进行覆盖 |
查看记录 | get '$tablename', $rowkey' |
查看表中的记录总数 | count '$tablename' |
删除记录 | delete '$tablename' ,'$rowkey' , '$col' |
禁用表 | disable '$tablename' |
删除一张表 | drop '$tablename' |
查看所有记录 | scan "$tablename" 该命令慎用,数据量大的表会导致瘫痪 |
查看某个表某个列中所有数据 | scan "$tablename" , ['$col:'] |
查看表的部分记录 | scan '$tablename', {LIMIT => 10, STARTROW => 'row01'},{ASSISTANT => true, STARTROW => 'value01'} |
添加Group | group_add '$group' |
将一台机器的region移走 | #~/hbase/bin/graceful_stop.sh $hostip |
移动指定的机器到指定的group | group_move_server '$hostip:port','$group' |
移动表到group | group_move_table '$tablename','$group' |
如果nn没有主,将其中一台置为active | hdfs haadmin -transitionToActive $nn1 |
查看复制信息:
hbase shell> status 'replication','source'