Manually Enable HBase Replication
After ensuring that HBase is running on both the source and destination clusters, you must configure certain parameters to manually enable replication.
- Configure the source and destination clusters and ensure that you have HBase running in both clusters. HBase master and region servers in the source cluster must be able to communicate with the master and all region servers in the destination cluster.
- On both clusters, create tables with the same names and column families, so that
the destination cluster stores the data that it receives in a logical
location:
hbase shell>create "t1","cf1"
- All hosts in the source and destination clusters should be reachable to each
other. If both clusters use the same ZooKeeper cluster, you must use a different
zookeeper.znode.parent
, because they cannot write in the same folder. - On the source cluster, in HBase shell, add the destination cluster as a
peer:
hbase shell>add_peer
“us_east”,”hostname.of.zookeeper:2181:/path-to-hbase”
- On HDP,
path-to-hbase
is either “/hbase-unsecure
” or “/hbase-secure
”. On the destination cluster, open thehbase-site.xml
file and look at the value ofzookeeper.znode.parent
to find out the HBase directory. - Ensure that replication has not been disabled. Ensure that the
hbase.replication
setting is set totrue
. - On the source cluster, in HBase shell, enable the table
replication:
Run
hbase shell>enable_table_replication "t1"
- Copy the HBase data from the source cluster to the destination
cluster:
$>hbase org.apache.hadoop.hbase.mapreduce.CopyTable --peer.adr=hostname.of.zookeeper:2181:/hbase-unsecure t1