couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Couchdb Wiki] Update of "Replication" by FilipeManana
Date Sat, 17 Sep 2011 23:35:07 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Couchdb Wiki" for change notification.

The "Replication" page has been changed by FilipeManana:
http://wiki.apache.org/couchdb/Replication?action=diff&rev1=33&rev2=34

  Specifying a local `source` database and a remote `target` database is called ''push replication''
and a remote `source` and local `target` is called ''pull replication''. As of CouchDB 0.9,
pull replication is a lot more efficient and resistant to errors, and it is suggested that
you use pull replication in most cases, especially if your documents are large or you have
large attachments.
  
  === Cancel replication ===
+ 
+ A replication triggered by POSTing to '''/_replicate/''' can be canceled by POSTing the
exact same JSON object but with the additional '''"cancel"''' property set to the boolean
''true'' value.
+ 
  {{{
  POST /_replicate HTTP/1.1
- {"source":"example-database","target":"http://example.org/example-database", "cancel": true}
+ {"source":"example-database", "target":"http://example.org/example-database", "cancel":
true}
  }}}
  
- Notice: request initiated replication will fail with error 500 (shutdown).
+ Notice: the request which initiated the replication will fail with error 500 (shutdown).
+ 
+ Starting from CouchDB version 1.2.0 (unreleased at the time of this writing), the original
replication object no longer needs to be known. Instead a simple JSON object with the fields
'''"replication_id"''' (a string) and '''"cancel"''' (set to the boolean ''true'' value) is
enough. The names ''_local_id'' and ''id'' are aliases to ''replication_id''. The replication
ID can be obtained from the original replication request (if it's a continuous replication),
from '''_active_tasks''' or from the log. Example:
+ 
+ {{{
+ $ curl -H 'Content-Type: application/json' -X POST http://localhost:5984/_replicate -d '
{"source": "http://myserver:5984/foo", "target": "bar", "create_target": true, "continuous":
true} '
+ {"ok":true,"_local_id":"0a81b645497e6270611ec3419767a584+continuous+create_target"}
+ 
+ $ curl -H 'Content-Type: application/json' -X POST http://localhost:5984/_replicate -d '
{"replication_id": "0a81b645497e6270611ec3419767a584+continuous+create_target", "cancel":
true} '
+ {"ok":true,"_local_id":"0a81b645497e6270611ec3419767a584+continuous+create_target"}
+ }}}
  
  
  === Continuous replication ===

Mime
View raw message