Return-Path: X-Original-To: apmail-hbase-user-archive@www.apache.org Delivered-To: apmail-hbase-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E7F9517CF4 for ; Sun, 25 Jan 2015 14:19:17 +0000 (UTC) Received: (qmail 86791 invoked by uid 500); 25 Jan 2015 14:19:15 -0000 Delivered-To: apmail-hbase-user-archive@hbase.apache.org Received: (qmail 86727 invoked by uid 500); 25 Jan 2015 14:19:15 -0000 Mailing-List: contact user-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@hbase.apache.org Delivered-To: mailing list user@hbase.apache.org Received: (qmail 86714 invoked by uid 99); 25 Jan 2015 14:19:14 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 25 Jan 2015 14:19:14 +0000 X-ASF-Spam-Status: No, hits=1.7 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of linshuai2012@gmail.com designates 209.85.217.169 as permitted sender) Received: from [209.85.217.169] (HELO mail-lb0-f169.google.com) (209.85.217.169) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 25 Jan 2015 14:19:10 +0000 Received: by mail-lb0-f169.google.com with SMTP id f15so4171188lbj.0 for ; Sun, 25 Jan 2015 06:18:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=9EkPRSwxWxAtNVb4U6qQBndTCx1SnNUSU1luTW4eaAw=; b=ZgrTsbghMG1FRLnvCAoVrxjoFynurWRUwOn/ZDW2MSeshsTR8F/CMFdAwkKdgoZH5i Wd+P2Mma9FmtwW+qeP7V7WbNye6OWL746kLMC18mLLkVBA0+z2WDkiBUdEDWiedB+oAC W/ZigmsSNbPXOKdIFVOvNfOS751TRJ0Fi/t/87nmpH3ulVlapCvHANFm3r7krt9z7qbc U5UPEUROco4SfD8P4d0aFAuOR7AZIJjEcukUmxa97z+mT/WiXNvjiCCfXo9R6AlhepC9 xDRyNNf1/siAqcmBBhvQOpR3Pqt5fgRAGoABHxKYvBsZn/r4hDXyKzrBs10yVnRqPCsw A7Aw== MIME-Version: 1.0 X-Received: by 10.112.50.239 with SMTP id f15mr16518146lbo.31.1422195484626; Sun, 25 Jan 2015 06:18:04 -0800 (PST) Received: by 10.114.246.38 with HTTP; Sun, 25 Jan 2015 06:18:04 -0800 (PST) In-Reply-To: References: Date: Sun, 25 Jan 2015 22:18:04 +0800 Message-ID: Subject: Re: Delete a region from hbase From: Shuai Lin To: user@hbase.apache.org Content-Type: multipart/alternative; boundary=001a113368d4a9948d050d7ab05a X-Virus-Checked: Checked by ClamAV on apache.org --001a113368d4a9948d050d7ab05a Content-Type: text/plain; charset=UTF-8 Hi Stack, After a grep in the hbase code, I see that the HRegion.deleteRegion method can not be found in hbase 0.96. So I'd better not using it since we have a plan to ugprade to CDH5 soon. I have tried the steps you described on a local hbase server: first call close_region from shell, then delete the region folder from HDFS, and finally assign that region in shell again, and it works fine. Thanks for your help! On Sun, Jan 25, 2015 at 11:03 AM, Stack wrote: > On Sat, Jan 24, 2015 at 9:25 AM, Shuai Lin wrote: > > > Hi all, > > > > We're using hbase 0.94-15 from CDH4 repo, and we're planning to delete > > several regions which contain data that are no longer needed. > > > > Basically we plan to use HRegion.deleteRegion > > < > > > http://archive.cloudera.com/cdh4/cdh/4/hbase-0.94.2-cdh4.2.0/apidocs/org/apache/hadoop/hbase/regionserver/HRegion.html#deleteRegion%28org.apache.hadoop.fs.FileSystem,%20org.apache.hadoop.fs.Path,%20org.apache.hadoop.hbase.HRegionInfo%29 > > > > > as described in this article. > > < > > > http://prafull-blog.blogspot.jp/2012/06/how-to-delete-hbase-region-including.html > > > > > > > We can guarantee that there would not be any request going to these > > regions during the deletion. Here are my questions: > > > > -- Is there any caveat of using this way to delete regions, especially > > those that may cause downtime? Because we'll delete the regions in our > > production cluster, we need really be careful of any possible > consequences. > > > > > The blog is using an API that is @InterfaceAudience.Private This means you > are taking a risk and all bets are off. > > > > > -- After deleting the region, do we really need to re-create it? If we do > > not recreate these regions, there would be "holes" in the rowkey space. > Can > > we use some tool like hbck to fix this? Another way is to just recreate > the > > regions, and later merge these empty regions with their neighbors. Which > > one is better? > > > > Better to avoid holes in your table. > > Its probably less work just doing the delete yourself as in: > > 1. Close the region from the shell (read up on how this works using shell > help -- don't do unassign) > 2. Then just delete the content of the region in HDFS once the region is > closed (the region dir name in HDFS is the same as the region encoded name, > the last portion of a region name -- check refguide). > 3. After the delete in HDFS, call assign region. > > Practice in a non-critical setup first. > St.Ack > --001a113368d4a9948d050d7ab05a--