Managing and Configuring HBase Cluster Replication
Process Overview
Configure and start the source and destination clusters. Create tables with the same names and column families on both the source and destination clusters, so that the destination cluster knows where to store the data that it receives.
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.Check to be sure that replication has not been disabled. The
hbase.replication
setting defaults totrue
.On the source cluster, in HBase shell, add the destination cluster as a peer, using the
add_peer
command.On the source cluster, in HBase shell, enable the table replication, using the
enable_table_replication
command.Check the logs to see if replication is taking place. If so, you see messages like the following, coming from the Replication Source:
LOG.info("Replicating "+ClusterId + " -> " + peerClusterId);
Table 4.4. HBase Cluster Management Commands
Command | Description |
---|---|
add_peer <ID> <CLUSTER_KEY> | Adds a replication relationship between two clusters:
|
list_peers | Lists all replication relationships known by the cluster. |
enable_peer <ID> | Enables a previously-disabled replication relationship. |
disable_peer <ID> | Disables a replication relationship. After disabling, HBase no longer sends edits to that peer cluster, but continues to track the new WALs that are required for replication to commence again if it is re-enabled. |
remove_peer <ID> | Disables and removes a replication relationship. After removal, HBase no longer sends edits to that peer cluster nor does it track WALs. |
enable_table_replication <TABLE_NAME> | Enables the table replication switch for all of the column families associated with that table. If the table is not found in the destination cluster, one is created with the same name and column families. |
disable_table_replication <TABLE_NAME> | Disables the table replication switch for all of the column families associated with that table. |