table replica autosetup
Sets up and starts replication between a source MapR-DB binary or JSON table to a replica MapR-DB binary or JSON table.
The maprcli table replica autosetup
command performs the following
steps to set up replication:
- Creates a table with the required column families in the destination cluster.
- Declares the new table to be a replica of the source table and ensures that replication does not begin immediately after the next step.
- Declares the source table as an upstream source for the replica.
- Runs the
CopyTable
utility to load a copy of the source data into the replica. - Clears the paused replication state to start the replication stream.
Permissions Required
To run this command, your user ID must have the following permissions:readAce
andwriteAce
on both the source volume and the target volumelookupdir
on directories in the paths of both tablesreadperm
andreplperm
permissions on the source table
mapr
user is not treated as a superuser.
MapR-DB does not allow the mapr
user to run this command unless that user
is given the relevant permission or permissions with access-control expressions.Syntax
- CLI
-
maprcli table replica autosetup -path <table path> -replica <replica table path> [ -columns <comma separated list of <family>[:<column>]> ] [ -synchronous <is synchronous replication> default: false ] [ -multimaster <is multi master replication> default: false ] [ -throttle <throttle replication ops> default: false ] [ -networkencryption <enable on-wire encryption> default: false ] [ -networkcompression <on-wire compression type: off|on|lzf|lz4|zlib> default: on ]
- REST
-
http[s]://<host>:<port>/rest/table/replica/autosetup?path=<path>&replica=<path>...
Parameters
path |
The path to the source table that you want to replicate.
|
replica |
The path to the replica.
NOTE: For replication to a table, the command will fail if the replica path
you specify points to table that already exists.
|
columns |
By default, all columns in the source table are replicated. If you do not want to replicate all columns in the table, you can
specify specific columns to replicate:
|
synchronous | A Boolean value that specifies whether replication is synchronous or
asynchronous. The values are true or
false. Asynchronous (false ) is the
default. |
multimaster | A Boolean value that specifies whether or not to set up a multi-master
topology. The values are true or false.
Basic master-slave topology (false ) is the default. |
throttle | A Boolean value that specifies whether or not to throttle replication
operations. Throttle the replication stream to minimize the impact of the
replication process on incoming operations during periods of heavy load. The
values are true or false. No throttle (false ) is the
default. |
networkencryption | A Boolean value that specifies whether or not to enable on-wire
encryption. The values are true or false .
No encryption (false) is the default. If
you set this to true , the local cluster and any other
cluster that is part of the replication process must be enabled for
security. |
networkcompression |
The type of on-wire compression. The types are:
lz4 is the default compression which it set by parameter values |
Example
- CLI
-
maprcli table replica autosetup -path /volume1/custBsrc -replica /volume2/custBdst
- REST
-
https://<host>:<port>/rest/table/replica/autosetup?path=%2Fvolume2%2FcustAsrc&replica=%2Fvolume2%2FcustBdst