Support Questions

Find answers, ask questions, and share your expertise

how to backup hive tables ?

avatar
New Contributor

Hi,

I have cluster of 24 nodes. I want to take backup of multiple hive tables and wanted to migrate over another cluster having 3 nodes. can anyone tell me the best way.

1 ACCEPTED SOLUTION

avatar

@Nikhil Pawar

1) Stop Hive on the target cluster

2) Distcp all the necessary files on HDFS to the secondary cluster.

3) Take a SQL dump of your Hive Metastore (which is in MySQL or Postgres).

4) Restore the SQL dump on your target cluster.

5) Use the Hive Metatool "-updateLocation" command on the target cluster to change the Metastore URIs

https://cwiki.apache.org/confluence/display/Hive/Hive+MetaTool

6) Start Hive on the target cluster

To make the process easier, assuming this is a one-time thing, I suggest that you copy the entire Metastore rather than trying to pick and choose certain tables. While being selective is possible, it will add a bit more complexity to your process.

View solution in original post

3 REPLIES 3

avatar

@Nikhil Pawar

1) Stop Hive on the target cluster

2) Distcp all the necessary files on HDFS to the secondary cluster.

3) Take a SQL dump of your Hive Metastore (which is in MySQL or Postgres).

4) Restore the SQL dump on your target cluster.

5) Use the Hive Metatool "-updateLocation" command on the target cluster to change the Metastore URIs

https://cwiki.apache.org/confluence/display/Hive/Hive+MetaTool

6) Start Hive on the target cluster

To make the process easier, assuming this is a one-time thing, I suggest that you copy the entire Metastore rather than trying to pick and choose certain tables. While being selective is possible, it will add a bit more complexity to your process.

avatar
New Contributor

thanks eyad.. i will check with this. thanks again