phoenix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anil gupta <anilgupt...@gmail.com>
Subject Re: About mapping a phoenix table
Date Tue, 02 Apr 2019 12:26:45 GMT
Hey Reid,
AFAIK, there is no official Phoenix tool to copy table between clusters. IMO, it would be
great to have an official tool to copy tables.
In our case, source and destination clusters are running Phoenix4.7. IMO, copy between 4.7-4.14
might have some version incompatibility. So, you might need to test following in non-prod
first. 

Approach 1: We usually move tables by taking a snapshot of hbase table, exporting the snapshot
to remote cluster, create Phoenix table, delete underlying hbase table, and restoring the
snapshot. Please keep in mind that you will need to do similar exercise if your table has
secondary indexes since they are stored in another hbase table.  Also, make sure that you
don’t have any live traffic to Phoenix table in destination cluster until restoring of snapshot
and verification of data in table.

Approach 2: Use copyTable util of hbase. In this case, you will just need to create Phoenix
table on remote cluster and then kick off hbase copy table. In this approach also, you will
need to perform copyTable for each secondary index. 

We usually use approach1 because it’s usually faster and doesn’t puts write load on cluster.

HTH,
Anil Gupta

> On Apr 2, 2019, at 4:32 AM, Reid Chan <reidddchan@outlook.com> wrote:
> 
> Hi team,
> 
> I'm trying to transport a phoenix table between two clusters, by copying all related
hbase files on hdfs from cluster A to cluster B.
> But after i executed CreateTableStatement in phoenix, phoenix failed to map those files
into table, and `select *` got nothing.
> 
> The questions are,
> Is there a proper way or tool to do the table transportation?
> If answer is no, can team provide some code pointers if i want to implement it?
> Or reason why is this infeasible?
> 
> FYI,
> both hbase version are both 1.x but different in minor version,
> phoenix version gap is huge, 4.7.0 and 4.14.1.
> 
> Any suggestions are appreciated!
> Thanks
> 
> 
> --------------------------
> 
> Best regards,
> R.C
> 
> 

Mime
View raw message