Uploaded image for project: 'HBase'
  1. HBase
  2. HBASE-548

Tool to online single region

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 0.1.0, 0.1.1, 0.2.0
    • 0.1.1, 0.2.0
    • None
    • None

    Description

      A sequence of events put a region offline in the middle of an online table. I was unable to get the region backon by running 'enable table'. Here is a little bit of code that I ran to bring the region back online and get the table running again. This issue is about adding it to hbase tools (A new package named 'tools'?).

        public static void main(String[] args) throws IOException {
          HBaseConfiguration c = new HBaseConfiguration();
          c.set("hbase.master", args[0]);
          HTable t = new HTable(c, new Text(".META."));
          Text row = new Text(args[1]);
          byte [] cell = t.get(row, new Text("info:regioninfo"));
          HRegionInfo info = Writables.getHRegionInfo(cell);
          LOG.info(info);
          long id = t.startUpdate(row);
          info.setOffline(false);
          t.put(id, COL_REGIONINFO, Writables.getBytes(info));
          t.delete(id, COL_SERVER);
          t.delete(id, COL_STARTCODE);
          t.commit(id);
        }
      

      Attachments

        1. 548-0.1.patch
          2 kB
          Michael Stack

        Activity

          People

            Unassigned Unassigned
            stack Michael Stack
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: