Preparing clusters for table replication includes configuring gateways on destination
clusters, configuring the mapr-clusters.conf file on the source
cluster, and, if the clusters are secure, setting up secure communications between the
clusters. After you prepare the clusters for table replication, you can setup replication
between tables.
The following topics identify concepts and tasks that you need to do before setting up your environment for table replication.
For example, suppose /vol mirrors to
/vol.mirror and contains a table
srcTab that replicates to
/replVol/replTab. If /vol fails,
/vol.mirror/srcTab may lag
/replVol/replTab when /vol.mirror is
promoted.
To avoid this problem, starting with the 6.1 release, after
HPE Ezmeral Data Fabric Database promotes a mirror volume,
replication terminates with REPLICA_STATE_UNEXPECTED for
any tables in that volume.
The following sample output shows this behavior:
[mapr]# /opt/mapr/bin/maprcli table replica list -path /vol.mirror/srcTab -refreshnow true -json
{
"timestamp":1534805233244,
"timeofday":"2018-08-20 03:47:13.244 GMT-0700 PM",
"status":"OK",
"total":1,
"data":[
{
"cluster":"mirrorSrc",
"table":"/replVol/replTab",
"type":"MapRDB",
"replicaPath":"/replVol/replTab",
"replicaState":"REPLICA_STATE_UNEXPECTED",
"paused":false,
"throttle":false,
"idx":1,
"networkencryption":false,
"synchronous":false,
"networkcompression":"lz4",
"propagateExistingData":false,
"isUptodate":true,
"minPendingTS":0,
"maxPendingTS":0,
"bytesPending":0,
"putsPending":0,
"bucketsPending":0,
"uuid":"8b4563e1-884d-7852-f257-078c397b5b00",
"copyTableCompletionPercentage":0,
"errors":{
"Code":"ErrReplicaTableUpstreamMismatch",
"Host":"10.10.104.35",
"Msg":"OpenStream: Upstream table does not match original Upstream cluster mirrorSrc table /replVol/replTab"
}
}
]
}This change in behavior applies to only tables that have replication enabled starting in 6.1. See Table Replication States for more details.
readAce permission on the
volume where the source tables are located and the writeAce
permission on the volumes where the replicas are located. For information about
how to set permissions on volumes, see Setting Whole Volume ACEs.maprcli command:
maprcli cluster feature enable -name
mfs.feature.db.repl.support
The following steps show how to set up your environment for table replication including setup for secure clusters.
mapr-clusters.conf file on every node in your source
cluster, add an entry that lists the CLDB nodes that are in the destination
cluster. This step is required so that the source cluster can communicate
directly with the destination cluster's CLDB nodes. See mapr-clusters.conf for the format to use for the entries. maprcli commands locally on them. See Configuring Secure Clusters for Running Commands Remotely for more information. maprlogin command:
maprlogin generateticket -type service -cluster <destination cluster>
-user mapr -duration <duration> -out <output folder>Where
-duration is the length of time before the
ticket expires. You can specify the value in either of these
formats:
[Days:]Hours:MinutesSeconds/opt/mapr/conf/mapruserticket file that was created
when you secured the source cluster:
at <path and filename of the service ticket> >> /opt/mapr/conf/mapruserticketmaprcli node
services command. For the syntax of this command, see node services. core-site.xml
file. For Hadoop 2.7.0, edit the file
/opt/mapr/hadoop/hadoop-2.7.0/etc/hadoop/core-site.xml.
<property>
<name>hadoop.proxyuser.mapr.hosts</name>
<value>*</value>
</property>
<property>
<name>hadoop.proxyuser.mapr.groups</name>
<value>*</value>
</property>