常用hbase shell 命令

  1. create Table 
    create 'mytable', {NAME => 'colfam1', VERSIONS => 1, TTL => 2592000, BLOCKCACHE => true}, {NAME => 'colfam2'}
     
  2.  truncate mytable   == disable / drop table 
  3.  Alter a table / add column family (Note: table must be disabled to make ColumnFamily modifications)
    alter 'mytable', {NAME => 'new_colfam'}, {NAME => 'colfam_to_delete', METHOD => 'delete'}
     
  4. scan mytable 
    scan ‘mytable’, {LIMIT=>10, STARTROW=>”start_row”, STOPROW=>”stop_row”}
     
    scan 'zchx_ais',{STARTROW=>"44164100020130903164330", STOPROW=>"44164100020130904164330"}
     
  5.  get mytable, row_key
  6. put mytable, row_key, colfam:qual, value
  7. delete 'mytable', 'row_key','colfam:qual'
  8. major_compact mytable 
  9. split 'mytable' 
  10. status 'detailed' 
  11. 查看某个表占空间大小
     hadoop fs -du /hbase/tablename
     

 

你可能感兴趣的:(shell)