HBase 리전 분산 이슈로 인한 region server 단위 hotspot 이 발생할 경우 대처방안

Jung-taek Lim
3 min readNov 26, 2015

--

HBase 의 기본 동작 기능인 Load Balancer 는 master server 에서 hbase.balancer.period 값을 주기로 수행됩니다.
기본값은 5 분입니다.
5 분마다 무조건 수행되지는 않고 region transition 이 발생하고 있지 않을 때에만 수행됩니다.

새로운 load balance plan 이 계산되어 리전을 옮기는 것으로 결정되면 관련 로그가 출력됩니다.

grep "StochasticLoadBalancer" <log dir>/hbase-hbase-master-<master server>.log

예시

2015-09-29 08:50:50.303 DEBUG org.apache.hadoop.hbase.master.balancer.StochasticLoadBalancer: Finished computing new load balance plan.  Computation took 30001ms to try 183948 different iterations.  Found a solution that moves 30 regions; Going from a computed cost of 24.565833447978264 to a new cost of 20.070346643850556

주의: Logging Level 이 DEBUG 로 되어 있어야 함

Load Balancer 에 의해 옮겨지는 리전들은 아래의 방법으로 확인할 수 있습니다.

grep "balance hri=" <log dir>/hbase-hbase-master-<master server>.log

hbase shell 에서 Load Balancer 동작을 임의로 trigger 할 수 있습니다.
(hbase shell 의 커맨드 관련은https://learnhbase.wordpress.com/2013/03/02/hbase-shell-commands/ 를 참고)
region transition 으로 인해 실행이 불가능하면 바로 false 라고 나오고 실행 가능하면 true 라고 나옵니다. 실제 이동은 async 하게 이루어집니다.

이와 별개로 hbase shell 에서 개별 리전을 move 할 수 있습니다.
move 로 인해 옮겨지는 리전들은 아래의 방법으로 확인할 수 있습니다.

grep "move hri=" <log dir>/hbase-hbase-master-<master server>.log

--

--

No responses yet