Skip to content

Instantly share code, notes, and snippets.

@avtar
Created October 10, 2013 01:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save avtar/6911747 to your computer and use it in GitHub Desktop.
Save avtar/6911747 to your computer and use it in GitHub Desktop.
Trigger replication of a database
curl \
-H "Content-Type: application/json" \
-X POST http://admin:password@localhost:5984/_replicate \
-d '{"source":"http://couchdb-rw1:5984/user", "target":"http://admin:password@127.0.0.1:5984/user", "create_target": true, "continuous":true}'
[Thu, 10 Oct 2013 01:06:24 GMT] [info] [<0.24306.0>] starting new replication `f47a8156e91b94eb714250c526a9566b+continuous+create_target` at <0.7815.23> (`http://couchdb-rw1:5984/user/` -> `http://admin:*****@localhost:5984/user/`)
[Thu, 10 Oct 2013 01:06:24 GMT] [info] [<0.24306.0>] 127.0.0.1 - - POST /_replicate 202
[Thu, 10 Oct 2013 01:06:24 GMT] [info] [<0.24303.0>] 127.0.0.1 - - POST /user/_revs_diff 200
[Thu, 10 Oct 2013 01:06:24 GMT] [info] [<0.24307.0>] 127.0.0.1 - - POST /user/_revs_diff 200
[Thu, 10 Oct 2013 01:06:24 GMT] [info] [<0.24295.0>] 127.0.0.1 - - POST /user/_revs_diff 200
[Thu, 10 Oct 2013 01:06:24 GMT] [info] [<0.24296.0>] 127.0.0.1 - - POST /user/_revs_diff 200
[Thu, 10 Oct 2013 01:06:24 GMT] [info] [<0.24295.0>] 127.0.0.1 - - POST /user/_bulk_docs 201
[Thu, 10 Oct 2013 01:06:24 GMT] [info] [<0.24307.0>] 127.0.0.1 - - POST /user/_bulk_docs 201
[Thu, 10 Oct 2013 01:06:24 GMT] [info] [<0.24303.0>] 127.0.0.1 - - POST /user/_bulk_docs 201
[Thu, 10 Oct 2013 01:06:24 GMT] [info] [<0.24296.0>] 127.0.0.1 - - POST /user/_bulk_docs 201
[Thu, 10 Oct 2013 01:06:24 GMT] [info] [<0.24295.0>] 127.0.0.1 - - POST /user/_revs_diff 200
[Thu, 10 Oct 2013 01:06:24 GMT] [info] [<0.24295.0>] 127.0.0.1 - - POST /user/_bulk_docs 201
[Thu, 10 Oct 2013 01:06:29 GMT] [info] [<0.24295.0>] 127.0.0.1 - - POST /user/_ensure_full_commit 201
[Thu, 10 Oct 2013 01:06:29 GMT] [info] [<0.7815.23>] recording a checkpoint for `http://couchdb-rw1:5984/user/` -> `http://admin:*****@localhost:5984/user/` at source update_seq 14
[Thu, 10 Oct 2013 01:06:29 GMT] [info] [<0.24295.0>] 127.0.0.1 - - PUT /user/_local/f47a8156e91b94eb714250c526a9566b 201
curl http://admin:password@localhost:5984/_active_tasks
[{"pid":"<0.7815.23>","checkpointed_source_seq":14,"continuous":true,"doc_id":null,"doc_write_failures":0,"docs_read":14,"docs_written":14,"missing_revisions_found":14,"progress":100,"replication_id":"f47a8156e91b94eb714250c526a9566b+continuous+create_target","revisions_checked":14,"source":"http://couchdb1:5984/user/","source_seq":14,"started_on":1381367184,"target":"http://admin:*****@localhost:5984/user/","type":"replication","updated_on":1381367539}]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment