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
8.9 Managing Cross Data Center Replication (XDCR)
Chapter Sections
Chapters

8.9.4. Creating XDCR Replications

To replicate data to an established destination cluster from a source cluster, you can use the REST API or Couchbase Web Console. Once you create a replication it will automatically begin between the clusters. As a REST call:

shell> curl -v -X POST -u Administrator:password1 http://10.4.2.4:8091/controller/createReplication 
-d uuid=9eee38236f3bf28406920213d93981a3 
-d fromBucket=beer-sample 
-d toCluster=remote1 
-d toBucket=remote_beer 
-d replicationType=continuous

This will send a request similar to the following example:

POST / HTTP/1.1
Authorization: Basic QWRtaW5pc3RyYXRvcjpwYXNzd29yZDE=
User-Agent: curl/7.21.4 (universal-apple-darwin11.0) libcurl/7.21.4 OpenSSL/0.9.8r zlib/1.2.5
Host: 10.4.2.4:8091
Accept: */*
Content-Length: 126
Content-Type: application/x-www-form-urlencoded

If Couchbase Server successfully create the replication, it will immediately begin replicating data from the source to destination cluster. You will get a response similar to the following JSON:

{
  "id": "9eee38236f3bf28406920213d93981a3/beer-sample/remote_beer",
  "database": "http://10.4.2.4:8092/_replicator"
}

The unique document ID returned in the JSON is a reference you can use if you want to delete the replication.

For more information about XDCR and creating a new replication see Section 5.8.5, “Configuring Replication”.