Configuring Fault Tolerance
Also available as:
PDF
loading table of contents...

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.

  1. 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.
  2. 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"
  3. 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.
  4. 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”
                                     
  5. On HDP, path-to-hbase is either “/hbase-unsecure” or “/hbase-secure”. On the destination cluster, open the hbase-site.xml file and look at the value of zookeeper.znode.parent to find out the HBase directory.
  6. Ensure that replication has not been disabled. Ensure that the hbase.replication setting is set to true.
  7. On the source cluster, in HBase shell, enable the table replication:

    Run

    hbase shell>enable_table_replication "t1"
  8. 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