Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

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

Solved Go to solution

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

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

1 ACCEPTED SOLUTION

Accepted Solutions

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

Expert Contributor

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
6 REPLIES 6

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

Expert Contributor

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

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

Expert Contributor

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.

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

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?

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

Expert Contributor

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.

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

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.

Highlighted

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

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 

Don't have an account?
Coming from Hortonworks? Activate your account here