xdcr-replicate

xdcr-replicate

Options to manage XDCR replications.

Syntax

The basic syntax is:

couchbase-cli xdcr-replicate -c [host]:[port] -u [admin] -p [password] [options]              

Description

Various XDCR operations.

Options

Note: Filtered XDCR is available only in Couchbase Server Enterprise Edition.

The following are the command options:

Table 1. xdcr-replicate options
Option Description
--create Create a new XDCR configuration.
--delete Delete an existing XDCR configuration.
--list List all XDCR configurations.
--pause Pause the replication.
--resume Resume the replication.
--settings Update settings for the replication.
--xdcr-replicator=REPLICATOR Replication ID.
--xdcr-from-bucket=BUCKET The local bucket name to replicate from.
--xdcr-to-bucket=BUCKETNAME Remote bucket to replicate to.
--checkpoint-interval=[1800] Interval between checkpoints, 60 to 14400 seconds.
--worker-batch-size=[500] Document batch size, 500 to 10000.
--doc-batch size=[2048]KB Document batch size, 10 to 100000 KB.
--failure-restart-interval=[30] Interval for restarting failed XDCR, 1 to 300 seconds.
--optimistic-replication-threshold=[256] Document body size threshold (bytes) to trigger optimistic replication.
--source-nozzle-per-node=[1-10] The number of source nozzles per target node. Default is 2.
--target-nozzle-per-node=[1-100] The number of outgoing nozzles per target node. Default is 2.
--log-level=[Error|Info|Debug|Trace] Logging level.
--stats-interval=[MS] The interval (in milliseconds) for statistics updates.
--xdcr-replication-mode=[xmem|capi] Replication protocol, either capi or xmem.
--filter-expression-mode=[REGEX] Regular expression to filter the replication streams.

Examples

To start a replication stream:

couchbase-cli xdcr-replicate -c 192.168.0.1:8091 -u Administrator -p password \
--create --xdcr-cluster-name=test \ 
--xdcr-from-bucket=default --xdcr-to-bucket=default1

To delete a replication stream:

couchbase-cli xdcr-replicate -c 192.168.0.1:8091 -u Administrator -p password \
--delete --xdcr-replicator=f4eb540d74c43fd3ac6d4b7910c8c92f/default/default

To start a replication stream with the memcached protocol and a regular expression as a filter, use the regex parameter:

couchbase-cli xdcr-replicate -c 192.168.0.1:8091 -u Administrator -p password \
--create --xdcr-cluster-name=test \ 
--xdcr-from-bucket=default --xdcr-to-bucket=default1 \ 
--xdcr-replication-mode=xmem --filter-expression-mode="192.168.1.\d{1,3}"