Support Questions
Find answers, ask questions, and share your expertise

Unable to take backup for hbase

I am unable to take backup for Hbase. I am trying below command inside bin directory of hbase

./hbase backup create full hdfs://192.168.0.1:9000/hbase_1 -w 3

But i get "Error: Could not find or load main class backup" as error. Do I need to add any extra jar file for backup? I am using hbase 1.2.6.

Any help on this would be appreciated.

12 REPLIES 12

The HBase backup and restore feature does not exist in any HBase 1.x release.

This feature was backported into HDP-2.5 and 2.6.

@Aditya Srivastava

Are you using Hortonworks Distribution/HDP Sandbox? If not you will not find the "backup" functionality in HBase 1.x lineup. Hortonworks has backported this functionality in its HDP and hence made it available with the "newer" versions[read 1.x] of HBase. Apache distribution of HBase had it in the previous releases but don't have it in the new release.

If you need backup functionality, I would recommend using Hortonworks Distribution of Hadoop [HDP] versions 2.5+.

Thanks!

@Aditya Srivastava

Did the answer help in the resolution of your query? Please close the thread by marking the answer as Accepted!

@Rahul Thanks for the response. I am using hbase as standalone and not the HDP Sandbox. Would really appreciate if you could help me with some alternative for HBase backup when used in standalone.

You may look the options available on HBase Documentation for backup.

Here is another link for some more details.

Expert Contributor

Hi @Aditya Srivastava,

You can use hbase snapshot feature to take backup of table.

http://hbase.apache.org/0.94/book/ops.snapshots.html

Hi @schhabra

As mentioned in above link provided by you, "HBase Snapshots allow you to take a snapshot of a table" whereas I want to take snapshot or backup of complete cluster.

Expert Contributor

As mentioned by Josh, backup/restore feature is not available in HBase 1.x release. The best option you have is SNAPSHOT in current version. You can create script to take snapshot of all tables.

You can use "snapshot_all" command to take snapshot of all tables at a time.

I tried using "snapshot_all" but it gives me error-:

hbase(main):002:0> snapshot_all

NameError: undefined local variable or method `snapshot_all'

Also when using help command, available command for snapshots are

Group name: snapshots

Commands: clone_snapshot, delete_all_snapshot, delete_snapshot, list_snapshots, restore_snapshot, snapshot

Mentor

@Aditya Srivastava

Please could you do the following and retry

export CLASSPATH=$CLASSPATH:`hbase classpath` 

When you navigate to /usr/hdp/current/hbase*/lib, do you find jar files?

Hi Geoffrey Shelton Okot

I have already set CLASSPATH. And yes I am able to view my jar files. What did you want me to achieve by following the above steps?

; ;