Hbase RegionServer 在集群内部不同组之间移动

方法一


1.先关指定组的balance
#hbase shell进去
关某个分组:
hbase shell>group_set_balance_switch '$group1',false
关全局:
hbase shell>balance_switch false


2. 移走region
nohup hbase org.apache.hadoop.hbase.util.RegionMover -host $hostname  -group $group1 -sleeptime 1000 -checkratio 999 -threads 5&
或者
hbase org.jruby.Main /home/hadoop/hbase-current/bin/region_mover.rb unload  $hostip:60020


3.确认机器上的region已经全部移走后,移动机器到新的组
hbase shell>group_move_server  '$hostip:60020','$group2'


4.恢复balance
hbase shell>group_set_balance_switch '$group1’,true



方法二


1. 移走region
~/hbase-current/bin/graceful_stop.sh  $hostip


2.确认机器上的region已经全部移走后,移动机器到group2
hbase shell>group_move_server  '$hostip:60020','$group2'Hbase机器在本集群不同组之间移动

猜你喜欢

转载自blog.csdn.net/liaynling/article/details/73478126