Resolve “org.apache.hadoop.hbase.NotServingRegionException” in Apache Hbase
Symptom:
The application fails while accessing the regions that are offline
org.apache.hadoop.hbase.NotServingRegionException: org.apache.hadoop.hbase.NotServingRegionException: test:test,4:sample.703243:201310,1632342333102.3067sdfs84js51dd3e374aa1bfa2bea. is not online on <hostname>,16020,1632342333102
Cause:
The HBase region is hosted in HBase meta but it’s not assigned to any region servers. If an application tries to read data from an unassigned region then the application will receive the above error.
ERROR
The table is still accessible but error only thrown for accessing un-assigned region, 1c7eaaf4060b3200f08e940145469ad1.
org.apache.hadoop.hbase.NotServingRegionException: test:test,4:sample.703243:201310,1632342333102.3067sdfs84js51dd3e374aa1bfa2bea. is not online on <hostname>,16020,1632342333102
Resolution:
Check the region state from the HBase meta, which can be collected by the below command
echo "scan 'hbase:meta'" | hbase shell | egrep "info:regioninfo|info:state" | grep <namespace:table> | grep <region>
Regions states would be either CLOSED or OFFLINE
From Regions logs:
sample.703243:201310,1632342333102.3067sdfs84js51dd3e374aa1bfa2bea. column=info:state, timestamp=1620003455215, value=CLOSED
— Use Hbck jar to assign manually
# hbase hbck -j hbase-hbck2-<version>.jar assigns <region>
Example:
hbase hbck -j hbase-hbck2-<version>.jar assigns 3067sdfs84js51dd3e374aa1bfa2bea
Good Luck with your Learning, Like the post if it is helpful