Return-Path: Delivered-To: apmail-hadoop-hbase-dev-archive@minotaur.apache.org Received: (qmail 99390 invoked from network); 2 Oct 2009 05:36:50 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 2 Oct 2009 05:36:50 -0000 Received: (qmail 7542 invoked by uid 500); 2 Oct 2009 05:36:50 -0000 Delivered-To: apmail-hadoop-hbase-dev-archive@hadoop.apache.org Received: (qmail 7476 invoked by uid 500); 2 Oct 2009 05:36:50 -0000 Mailing-List: contact hbase-dev-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: hbase-dev@hadoop.apache.org Delivered-To: mailing list hbase-dev@hadoop.apache.org Received: (qmail 7466 invoked by uid 99); 2 Oct 2009 05:36:50 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 Oct 2009 05:36:50 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 Oct 2009 05:36:47 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id CB033234C004 for ; Thu, 1 Oct 2009 22:36:25 -0700 (PDT) Message-ID: <348220847.1254461785817.JavaMail.jira@brutus> Date: Thu, 1 Oct 2009 22:36:25 -0700 (PDT) From: "Woosuk Suh (JIRA)" To: hbase-dev@hadoop.apache.org Subject: [jira] Commented: (HBASE-1867) Tool to regenerate an hbase table from the data files In-Reply-To: <2064909871.1253836215975.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/HBASE-1867?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12761478#action_12761478 ] Woosuk Suh commented on HBASE-1867: ----------------------------------- Your script worked perfectly with the HBase cluster with 4 running machines having 1011 regions. I used your script because our .META. region evaporated for some unknown reason. FYI, each server has 5GB memory and intel quad core CPU. But sometimes I was not able to run the script because the errors happened. So I`m going to give you all the process that I took to make the script work. 1. Our table had the structure on HDFS like this. /hbase/TABLENAME 2. So I moved hbase to hbase_backup /hbase_backup/TABLENAME 3. And then started hbase so the broken .META. table would regenerate cleanly. After starting hbase, /hbase/ /hbase_backup/TABLENAME 4. And then I ran the script like this bin/hbase org.jruby.Main add_table.rb hdfs://our.server.addr:port/hbase_backup/TABLENAME Then I got the error from line 105, statuses were "nil" objects. Unable to iterate nil objects. 5. I`m not familiar to ruby but python, so I think it was impossible to iterate through None objects. I printed the tableDir with LOG.info(tableDir.toString()) and I got following. our.server.addr:port/hbase_backup/TABLENAME 6. So, I tried to copy the hbase_backup/TABLENAME to hbase/TABLENAME like following bin/hadoop dfs -cp hbase_backup/TABLENAME hbase/TABLENAME 7. After a long time, copy process finished. And I tried to run the script again with following command. bin/hbase org.jruby.Main add_table.rb hdfs://our.server.addr:port/hbase/TABLENAME And it worked without any error or problem and all the regions were restored! I hope this usage information helps your code improved. Thanks for fabulous script! > Tool to regenerate an hbase table from the data files > ----------------------------------------------------- > > Key: HBASE-1867 > URL: https://issues.apache.org/jira/browse/HBASE-1867 > Project: Hadoop HBase > Issue Type: New Feature > Components: util > Affects Versions: 0.20.0 > Reporter: elsif > Priority: Minor > Attachments: add_table.rb > > > The purpose of this JIRA is provide a place to coordinate the development of a utility that will regenerate an hbase table from the data files. > Here are some comments from stack on this subject from the hbase-user mailing list: > Well, in the bin directory, there are scripts that do various things with > the .META. (copy a table, move a table, load a table whose source is hfiles > written by a mapreduce job; i.e. hbase-48). > So, to 'regenerate an hbase table from the data files', you'd need to do > something like the following: > + delete all exisiting table references from .META. > + move the backuped up table into position under hbase.rootdir > + per region under hbase.rootdir, add an entry to .META. Do this by opening > the .regioninfo file. Its content is needed to generate the rowid for > .META. and its value becomes the info:regioninfo cell value. > HBase does not need to be down. On next .META. scan, the newly added > regions will be noticed. They won't have associated info:server and > info:startcode entries so master will go ahead and assign them and you > should be up and running. > Code-wise, a study of copy_table.rb (this uses old api ... needs updating > but the concepts are the same) and loadtable.rb would probably be fruitful. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.