Support Questions

Find answers, ask questions, and share your expertise

How to move all the regions of a region server to another manually?

avatar
Contributor

Need to move all the regions of a region server to another region server manually

1 ACCEPTED SOLUTION

avatar
Super Collaborator

Hi @Aishwarya Dixit

You can use the command move in hbase shell.

Examples:
  hbase> move 'ENCODED_REGIONNAME'
  hbase> move 'ENCODED_REGIONNAME', 'SERVER_NAME'

Here is some help for this command:
Move a region.  Optionally specify target regionserver else we choose one at random.  

NOTE: You pass the encoded region name, not the region name so this command is a little different to the others.  

The encoded region name is the hash suffix on region names: 
e.g. if the region name were
TestTable,0094429456,1289497600452.527db22f95c8a9e0116f0cc13c680396. 
then the encoded region name portion is 527db22f95c8a9e0116f0cc13c680396

A server name is its host, port plus startcode. 
For example: host187.example.com,60020,1289493121758

View solution in original post

6 REPLIES 6

avatar
Super Collaborator

Hi @Aishwarya Dixit

You can use the command move in hbase shell.

Examples:
  hbase> move 'ENCODED_REGIONNAME'
  hbase> move 'ENCODED_REGIONNAME', 'SERVER_NAME'

Here is some help for this command:
Move a region.  Optionally specify target regionserver else we choose one at random.  

NOTE: You pass the encoded region name, not the region name so this command is a little different to the others.  

The encoded region name is the hash suffix on region names: 
e.g. if the region name were
TestTable,0094429456,1289497600452.527db22f95c8a9e0116f0cc13c680396. 
then the encoded region name portion is 527db22f95c8a9e0116f0cc13c680396

A server name is its host, port plus startcode. 
For example: host187.example.com,60020,1289493121758

avatar
Super Collaborator

Hi @Aishwarya Dixit Did it work ?

You can always Shutdown the Region Server process, and Hbase Master will reassign all Regions to a different Region Server host.

avatar
Contributor

hi @Saumil Mayani, Thank you so much for the answer, it did work. Just wanted to know if all the regions can be collectively moved instead of moving every region individually?

avatar
Super Collaborator

hi @Aishwarya Dixit you can gracefully shutdown the region server, that will trigger hbase Mater to perform a bulk assignment of all regions hosted by that region server.

avatar
New Contributor

Hi @smayani, Thanks for your response, considering a Production environment where too many writes are being performed on the regions hosted by that RS in parallel, do you suggest that we need to have an application downtime when we take a graceful shutdown of RS for the time when HMaster performs a bulk reassignment of regions.

Also, when we use move command in hbase shell to move a region to new RS, is there any impact on a running job if it is writing data to the same region.

avatar
Contributor

HI @hadoopguy 

Yes there is an impact you will have longer processing time and the operations will be queued. 

You have to carefully handle the timeout in your jobs. 

 

Best,

@helmi_khalifa