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
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
- On HDP,
path-to-hbaseis either “
/hbase-unsecure” or “
/hbase-secure”. On the destination cluster, open the
hbase-site.xmlfile and look at the value of
zookeeper.znode.parentto find out the HBase directory.
- Ensure that replication has not been disabled. Ensure that the
hbase.replicationsetting is set to
- On the source cluster, in HBase shell, enable the table
hbase shell>enable_table_replication "t1"
- Copy the HBase data from the source cluster to the destination
$>hbase org.apache.hadoop.hbase.mapreduce.CopyTable --peer.adr=hostname.of.zookeeper:2181:/hbase-unsecure t1