You can create table on the destination cluster by extracting the schema using HBase
Shell.
If the table to be replicated does not yet exist on the destination cluster, you must
create it.
-
On the source cluster,
describe the table using HBase
Shell.
The output is reformatted for readability:
hbase> describe acme_users
Table acme_users is ENABLED
acme_users
COLUMN FAMILIES DESCRIPTION
{NAME => 'user', DATA_BLOCK_ENCODING => 'NONE', BLOOMFILTER => 'NONE',
REPLICATION_SCOPE => '0', VERSIONS => '3', COMPRESSION => 'NONE',
MIN_VERSIONS => '0', TTL => 'FOREVER', KEEP_DELETED_CELLS => 'FALSE',
BLOCKSIZE => '65536', IN_MEMORY => 'false', BLOCKCACHE => 'false'}
-
Copy the output and make the following changes:
- For the TTL, change
FOREVER to
org.apache.hadoop.hbase.HConstants::FOREVER.
- Add the word
CREATE before the table name.
- Remove the line
COLUMN FAMILIES DESCRIPTION and
everything above the table name.
A command like the
following:
create 'cme_users' ,
{NAME => 'user', DATA_BLOCK_ENCODING => 'NONE', BLOOMFILTER => 'NONE',
REPLICATION_SCOPE => '0', VERSIONS => '3', COMPRESSION => 'NONE',
MIN_VERSIONS => '0', TTL => org.apache.hadoop.hbase.HConstants::FOREVER, KEEP_DELETED_CELLS => 'FALSE',
BLOCKSIZE => '65536', IN_MEMORY => 'false', BLOCKCACHE => 'false'}
-
Paste the command into HBase Shell on the destination cluster.
The table is created.