Home | About | Sematext search-lucene.com search-hadoop.com
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB
 Search Hadoop and all its subprojects:

Switch to Threaded View
HBase >> mail # user >> Import HBase snapshots possible?


Copy link to this message
-
Re: Import HBase snapshots possible?
Ok, so to export a snapshot from your HBase cluster, you can do
$ bin/hbase class org.apache.hadoop.hbase.snapshot.tool.ExportSnapshot
-snapshot MySnapshot -copy-to hdfs:///srv2:8082/my-backup-dir

Now on cluster2, hdfs:///srv2:8082 you've your my-backup-dir that contains
the exported snapshot (note that the snapshot is under hidden dirs
.snapshots, and .archive)

Now if you want to restore the snapshot,  you have to export it back an
HBase cluster.
So on cluster2, you can do:
$ bin/hbase class org.apache.hadoop.hbase.snapshot.tool.ExportSnapshot -D
hbase.rootdir=hdfs:///srv2:8082/my-backup-dir -snapshot MySnapshot -copy-to
hdfs:///hbaseSrv:8082/hbase
so, to recap
 - You take a snapshot
 - You Export the snapshot from HBase Cluster-1 -> to a simple HDFS dir in
Cluster-2
 - Then you want to restore
 - You Export the snapshot from HDFS dir in Cluster-2 to HBase Cluster (it
can be a different one from the original)
 - From the hbase shell you can just: clone_snapshot 'snapshotName',
'newTableName' if the table does not exists or use restore_snapshot
'snapshotName', if there's a table with the same name
Matteo

On Thu, Aug 1, 2013 at 2:54 PM, Siddharth Karandikar <
[EMAIL PROTECTED]> wrote:

> Yeah, thats right. But the issue is, hdfs that I am exporting to is
> not under HBase.
> Can you please provide some example command to do this...
>
>
> Thanks,
> Siddharth
>
> On Thu, Aug 1, 2013 at 7:17 PM, Matteo Bertozzi <[EMAIL PROTECTED]>
> wrote:
> > Yes, the export an HDFS path.
> > $ bin/hbase class org.apache.hadoop.hbase.snapshot.tool.ExportSnapshot
> > -snapshot MySnapshot -copy-to hdfs:///srv2:8082/hbase
> >
> > so you can export to some /my-backup-dir on your HDFS
> > and then you've to export back to an hbase cluster, when you want to
> > restore it
> >
> > Matteo
> >
> >
> >
> > On Thu, Aug 1, 2013 at 2:45 PM, Siddharth Karandikar <
> > [EMAIL PROTECTED]> wrote:
> >
> >> Can't I export it to plain HDFS? I think that would be very useful.
> >>
> >> On Thu, Aug 1, 2013 at 7:08 PM, Matteo Bertozzi <
> [EMAIL PROTECTED]>
> >> wrote:
> >> > The ExportSnapshot will export the snapshot data+metadata, in theory,
> to
> >> > another hbase cluster.
> >> > so on the second cluster you'll now be able to do "list_snapshots"
> from
> >> > shell and see the exported snapshot.
> >> > now you can simply do clone_snapshot "snapshot_name", "new_table_name"
> >> and
> >> > you're restoring a snapshot on the second cluster
> >> >
> >> > assuming that you have removed the snapshot from cluster1 and you
> want to
> >> > export back your snapshot..
> >> > you just use ExportSnapshot again to move the snapshot from cluster2
> to
> >> > cluster1
> >> > and same as before you do a clone_snapshot to restore it
> >> >
> >> > Matteo
> >> >
> >> >
> >> >
> >> > On Thu, Aug 1, 2013 at 2:35 PM, Siddharth Karandikar <
> >> > [EMAIL PROTECTED]> wrote:
> >> >
> >> >> Hi there,
> >> >>
> >> >> I am testing out newly added snapshot capability, ExportSnapshot in
> >> >> particular.
> >> >> Its working fine for me. I am able to run ExportSnapshot properly.
> >> >>
> >> >> But the biggest (noob) issue is, once exported, is there any way to
> >> >> import those snapshots back in hbase? I don't see any ImportSnapshot
> >> >> util there.
> >> >>
> >> >>
> >> >> Thanks,
> >> >> Siddharth
> >> >>
> >>
>
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB