Hbase

2019-12-16 17:22:06 浏览数 (1)

后台访问地址:http://192.168.200.151:16010/

代码语言:javascript复制
COMMAND GROUPS:
  Group name: general
  Commands: status, table_help, version, whoami

  Group name: ddl
  Commands: alter, alter_async, alter_status, create, describe, disable, disable_all, drop, drop_all, enable, 
enable_all, exists, get_table, is_disabled, is_enabled, list, show_filters

  Group name: namespace
  Commands: alter_namespace, create_namespace, describe_namespace, drop_namespace, list_namespace, list_namesp
ace_tables

  Group name: dml
  Commands: append, count, delete, deleteall, get, get_counter, get_splits, incr, put, scan, truncate, truncat
e_preserve

  Group name: tools
  Commands: assign, balance_switch, balancer, balancer_enabled, catalogjanitor_enabled, catalogjanitor_run, ca
talogjanitor_switch, close_region, compact, compact_rs, flush, major_compact, merge_region, move, split, trace
, unassign, wal_roll, zk_dump

  Group name: replication
  Commands: add_peer, append_peer_tableCFs, disable_peer, disable_table_replication, enable_peer, enable_table
_replication, list_peers, list_replicated_tables, remove_peer, remove_peer_tableCFs, set_peer_tableCFs, show_p
eer_tableCFs

  Group name: snapshots
  Commands: clone_snapshot, delete_all_snapshot, delete_snapshot, list_snapshots, restore_snapshot, snapshot

  Group name: configuration
  Commands: update_all_config, update_config

  Group name: quotas
  Commands: list_quotas, set_quota

  Group name: security
  Commands: grant, revoke, user_permission

  Group name: procedures
  Commands: abort_procedure, list_procedures

  Group name: visibility labels
  Commands: add_labels, clear_auths, get_auths, list_labels, set_auths, set_visibility

[root@ha1 sungrow]# cd /soft/hbase-1.1.10/bin [root@ha1 bin]# hbase shell

代码语言:javascript复制
#添加数据
hbase(main):053:0> put 'shiye_table',"rowkey2","family1:adder","hefei"
0 row(s) in 0.0040 seconds

#查询数据到 rowkey
hbase(main):056:0> get "shiye_table","rowkey2"
COLUMN                       CELL                                                                             
 family1:adder               timestamp=1575856594395, value=hefei                                             
 family1:age                 timestamp=1575856605415, value=123                                               
 family1:cell                timestamp=1575856467046, value=zhangsan                                          
3 row(s) in 0.0070 seconds

#查询数据到 rowkey,列族
hbase(main):057:0> get "shiye_table","rowkey2","family1"
COLUMN                       CELL                                                                             
 family1:adder               timestamp=1575856594395, value=hefei                                             
 family1:age                 timestamp=1575856605415, value=123                                               
 family1:cell                timestamp=1575856467046, value=zhangsan 

#查询数据到 rowkey,列族,列
hbase(main):059:0> get "shiye_table","rowkey2","family1:cell"
COLUMN                       CELL                                                                             
 family1:cell                timestamp=1575856467046, value=zhangsan                                          
1 row(s) in 0.0070 seconds


#查询全部数据
hbase(main):060:0> scan "shiye_table"

#开始于
hbase(main):067:0> scan "shiye_table",{STARTROW=>'rowkey3'}
ROW                          COLUMN CELL                                                                      
 rowkey3                     column=family1:cell, timestamp=1575856481919, value=lisi                         
 rowkey4                     column=family1:cell, timestamp=1575856493361, value=1234                         
 rowkey5                     column=family1:cell, timestamp=1575856510335, value=9876                         
 rowkey6                     column=family1:cell, timestamp=1575856521387, value=7654                         
4 row(s) in 0.0070 seconds

#结束于
hbase(main):068:0> scan "shiye_table",{STOPROW=>'rowkey3'}
ROW                          COLUMN CELL                                                                      
 rowkey1                     column=family1:cell, timestamp=1575855779825, value=value_shiye                  
 rowkey2                     column=family1:adder, timestamp=1575856594395, value=hefei                       
 rowkey2                     column=family1:age, timestamp=1575856605415, value=123                           
 rowkey2                     column=family1:cell, timestamp=1575856467046, value=zhangsan                     
2 row(s) in 0.0170 seconds

0 人点赞