Search:

Search all manuals
Search this manual
Manual
Couchbase Server Manual 2.0
Community Wiki and Resources
Download Couchbase Server 2.0
Couchbase Developer Guide 2.0
Client Libraries
Couchbase Server Forum
Additional Resources
Community Wiki
Community Forums
Couchbase SDKs
Parent Section
5.8 Cross Datacenter Replication (XDCR)
Chapter Sections
Chapters

5.8.5. Configuring Replication

You configure replications using the XDCR tab of the Administration Web Console. You configure replication on a bucket basis. If you want to replicate data from all buckets in a cluster, you should individually configure replication for each bucket.

Before You Configure XDCR

Ongoing Replications are those replications that are currently configured and operating. You can monitor the current configuration, current status, and the last time a replication process was triggered for each configured replication.

Under the XDCR tab you can also configure Remote Clusters for XDCR; these are named destination clusters you can select when you configure replication. When you configure XDCR, the destination cluster reference should point to the IP address of one of the nodes in the destination cluster.

Warning

Before you set up replication via XDCR, you should be certain that a destination bucket already exists. If this bucket does not exist, replication via XDCR may not find some shards on the destination cluster; this will result in replication of only some data from the source bucket and will significantly delay replication. This would also require you to retry replication multiple times to get a source bucket to be fully replicated to a destination.

Therefore make sure that you check that a destination bucket exists. The recommended approach is try to read on any key from the bucket. If you receive a 'key not found' error, or the document for the key, the bucket exists and is available to all nodes in a cluster. You can do this via a Couchbase SDK with any node in the cluster. See Couchbase Developer Guide 2.0, Performing Connect, Set and Get.

For more information about creating buckets via the REST API, see Section 8.6.5, “Creating and Editing Data Buckets”.

To create a uni-directional replication (i.e. from cluster A to cluster B):

  1. Check and ensure that a destination bucket exists on the cluster to which you will be replicating. To do so, perform this REST API request:

    curl -u Admin:password http://ip.for.destination.cluster:8091/pools/default/buckets
  2. To set up a destination cluster reference, click the Create Cluster Reference button. You will be prompted to enter a name used to identify this cluster, the IP address, and optionally the administration port number for the remote cluster.

    Figure 5.16. Couchbase Web Console - Replication Cluster Reference

    Couchbase Web Console - Create Cluster Reference

    Enter the username and password for the administrator on the destination cluster.

  3. Click Save to store new reference to the destination cluster. This cluster information will now be available when you configure replication for your source cluster.

  4. Click Create Replication to configure a new XDCR replication. A panel appears where you can configure a new replication from source to destination cluster.

  5. In the Replicate changes from section select a from the current cluster that is to be replicated. This is your source bucket.

  6. In the To section, select a destination cluster and enter a bucket name from the destination cluster:

    Figure 5.17. Couchbase Web Console - Replication Configuration

    Couchbase Web Console - Replication Configuration

  7. Click the Replicate button to start the replication process.

After you have configured and started replication, the web console will show the current status and list of replications in the Ongoing Replications section:

Figure 5.18. Couchbase Web Console - Replication Monitoring

Couchbase Web Console - Ongoing Replications

Configuring Bi-Directional Replication

Replication is unidirectional from one cluster to another. To configure bidirectional replication between two clusters, you need to provide settings for two separate replication streams. One stream replicates changes from Cluster A to Cluster B, another stream replicates changes from Cluster B to Cluster A. To configure a bidirectional replication:

  1. Create a replication from Cluster A to Cluster B on Cluster A.

  2. Create a replication from Cluster B to Cluster A on Cluster B.

You do not need identical topologies for both clusters; you can have a different number of nodes in each cluster, and different RAM and persistence configurations.

You can also create a replication using the Administration REST API instead of Couchbase Web Console. For more information, see Section 8.9.1, “Getting a Destination Cluster Reference”.

After you create a replication between clusters, you can configure the number of parallel replicators that run per node. The default number of parallel, active streams per node is 32, but you can adjust this. For information on changing the internal configuration settings, see Section 8.9.6, “Viewing Internal XDCR Settings”.