Created 07-26-2016 07:17 AM
We are primarily using the phoenix interface to access hbase (created tables, store and delete data). what is the best way to back up phoenix tables. Is there a way of doing it automatically in ambari or is anyone following a practice for this.
Created 07-26-2016 07:39 AM
Phoenix tables are the same as HBase tables so as per your need, you can use any backup method available in hbase.
http://hbase.apache.org/book.html#ops.backup
Taking a snapshot of all SYSTEM tables and user tables and exporting in some cold storage is an good option until incremental backup and restore feature in hbase got released (though active development is going on so expected to be released soon in HDP).
Created 07-26-2016 07:18 AM
Currently there is no backup functionality specific for Phoenix. Meanwhile you may use HBase snapshots. You need to snapshot SYSTEM tables as well as user tables. In the next release of HDP there will be HBase backup functionality. And hopefully quite soon we will see Phoenix backup based on it.
Created 07-26-2016 07:23 AM
Right now there is now way we can do it in ambari.
You will have to write custom scripts to take the backup. Use import/export or snapshot features of HBase to take the backups.
Created 07-26-2016 07:39 AM
Phoenix tables are the same as HBase tables so as per your need, you can use any backup method available in hbase.
http://hbase.apache.org/book.html#ops.backup
Taking a snapshot of all SYSTEM tables and user tables and exporting in some cold storage is an good option until incremental backup and restore feature in hbase got released (though active development is going on so expected to be released soon in HDP).
Created 07-26-2016 08:55 AM
Thanks, Ankit. but if we need to restore the hbase tables from snapshots and if they gets restored as hbase tables. will we need to build a view on top of the hbase tables to access it as phoenix tables.
Created 07-26-2016 08:57 AM
when you restore SYSTEM tables too, the metadata of all tables will be available , so you don't need to create any metadata again(like view/table) to access the user tables.
Created 07-26-2016 09:36 AM
Thanks Ankit. this helps.
Created 03-16-2017 01:44 AM
Here is what I wrote:
cat <<EOF | /usr/hdp/current/phoenix-client/bin/sqlline.py localhost:2181:/hbase-unsecure &> /dev/null !brief !set outputformat csv !set showwarnings false !set silent true !set headerinterval 0 !set showelapsedtime false !set incremental true !set showheader true !record /shared/backup.csv select * from d.test_table; !record !quit EOF
Working well so far (13M rows) after implementing suggestions here: https://community.hortonworks.com/content/supportkb/49037/phoenix-sqlline-query-on-larger-data-set-f...
Created 03-20-2019 05:41 PM
Hi all,
Do you have any suggestion for backing up and restore only 1 Phoenix table ? I believe if we restore the system table, it will have impact to all others, won't it ?
Many thanks,
Tu