Configuring Table Replication
Configuring table replication between two Data Fabric clusters involves using maprcli
commands to configure cross-cluster
trust, register the destination gateway, and set up replication. This task contains an
example of configuring simple primary-secondary
table replication between
two clusters.
About this task
This task configures simple primary-secondary
table replication
between two clusters.
Procedure
- Configure cross-cluster trust between the two clusters.
-
Register the destination gateway on the source node by executing the
cluster gateway set
command.In the following example:-
The name of the remote cluster is:
mydfcluster2
-
The gateway service name is:
mip-ap77-n3-vm02.mip.your.company.net:10007
maprcli cluster gateway set -dstcluster mydfcluster2 -gateways "mip-ap77-n3-vm02.mip.your.company.net:10007"
You can obtain the gateway service name for a cluster by executing the following command on the cluster:
kubectl exec -i admincli-0 -n dataplatform -- /bin/bash -c "maprcli cluster gateway list"
-
-
Set up primary-secondary replication for an existing source table by executing
the following command:
maprcli table replica autosetup
-
Check the replication status by executing the following command:
maprcli table replica list
Configuring Table Replication
echo mapr | maprlogin password
echo -e "create '/tmp/t1', 'cf1'\nput '/tmp/t1', 'r1', 'cf1:c1', 'v1'\nlist '/tmp/ t1'\nscan '/tmp/t1'\nexit" | /usr/bin/hbase shell
maprcli table replica autosetup -path /tmp/t1 -replica /mapr/mydfcluster2/t2 sleep 30
maprcli table replica list -path /tmp/t1
echo -e "put '/tmp/t1', 'r2', 'cf1:c1', 'v2'\nexit" | /usr/bin/hbase shell
echo -e "scan '/tmp/t1'\nscan '/mapr/mydfcluster2/t2'\nexit" | /usr/bin/hbase shell