hbase 管理工具

split 拆分
merge_region 合并分区

flush 
将memstore中的数据强制写入磁盘
 hbase> flush 'TABLENAME'
 hbase> flush 'REGIONNAME'
 hbase> flush 'ENCODE_REGIONNAME'


move
将region移动到一个指定的region server, 或者移动到一个随机的region server(不指定region server)。此命令可以用于解决某些region server 过于拥堵的问题。
 hbase> move 'ENCODE_REGIONNAME'
 hbase> move 'ENCODE_REGIONNAME', 'SERVER_NAME,PORT,START_CODE'    
 
 move '353a385f28af52ed47e675f18242bbf8', 'centos2,16020,1491104480825' 
 其中target server的start code, 可通过 scan 'hbase:meta'查找,或者用http://centos3:16030/rs-status查找,或者用命令status ‘simple’找到


close_region  (for experts only)
关闭单个region,使其offline
 hbase> close_region 'REGIONNAME'
 hbase> close_region 'REGIONNAME', 'SERVER_NAME'
 hbase> close_region 'ENCODED_REGIONNAME'
 hbase> close_region 'ENCODED_REGIONNAME', 'SERVER_NAME'

 Use assign to reopen/reassign.  Use unassign or move to assign the region elsewhere on cluster.
 
 
assign  (for experts only)
Assign a region. Use with caution. If region already assigned, this command will do a force reassign. For experts only.
 hbase> assign 'REGIONNAME'
 hbase> assign 'ENCODED_REGIONNAME'


unassign   (for experts only)
Unassign a region. Unassign will close region in current location and then reopen it again.  Pass 'true' to force the unassignment ('force' will clear all in-memory state in master before the reassign. If results in double assignment use hbck -fix to resolve. To be used by experts). Use with caution.  For expert use only.  Examples:
 hbase> unassign 'REGIONNAME'
 hbase> unassign 'REGIONNAME', true
 hbase> unassign 'ENCODED_REGIONNAME'
 hbase> unassign 'ENCODED_REGIONNAME', true


balancer_switch
balancer
balancer_switch控制是否启用region的负载均衡算法。如果负载均衡算法已开启,balance能主动运行负载均衡算法将region服务器上的region进行均匀再分配。

猜你喜欢

转载自oracle-api.iteye.com/blog/2367145