Expert Contributor
Posts: 162
Registered: ‎09-29-2014

Hbase add table meta

Hi, everyone: i am testing HBASE backup and restore, but so disappoint about hbase hbck. my testing is below: 1. backup hbase table hadoop fs -copyToLocal hdfs:// /tmp/db_slow_query_hbasecopy 2.drop hbase table disable 'db_slow_query_hbasecopy' drop 'db_slow_query_hbasecopy' 3. restore backup table to hbase hadoop fs -copyFromLocal /tmp/db_slow_query_hbasecopy hdfs:// after that, we can say the data already restore to HBASE, but the meta should be fixed. i have search from google, many peoples say using command like : " hbase org.jruby.Main add_table.rb " can fix meta problem, but i didn't find any executable file add_table.rb. then i am going to fix this problem by "hbase hbck -repairehole or hbase hbck -repair", but the it's always zookeeper timeout, the errors like below: Exception in thread "main" Region {ENCODED => 9e2cabdfd2eec5a1d419297897224d9b, NAME => 'db_slow_query_hbasecopy,,1445571407832.9e2cabdfd2eec5a1d419297897224d9b.', STARTKEY => '', ENDKEY => ''} failed to move out of transition within timeout 120000ms everyone who can you give some advises to me? thanks.
Posts: 1,892
Kudos: 431
Solutions: 302
Registered: ‎07-31-2013

Re: Hbase add table meta

If your goal is to take backups of a HTable, please use the recommended approach of taking a Snapshot and then using ExportSnapshot to copy it to an exterior location. Use of any other method to "replace" tables is not a good solution nor is recommended.

You can consider also the OfflineMetaRepair but this will require a downtime of the cluster.