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 StephaneAlnet:
http://wiki.apache.org/couchdb/Replication?action=diff&rev1=37&rev2=38
Comment:
Added entry on Authorization for replication, with a workaround for URI-encoded characters
in username or password
* [[Replication_and_conflicts|Replication and conflicts]]
* [[How_to_design_for_replication|How to design for replication]]
+ === Authentication ===
+
+ In some versions of CouchDB, if the remote username or password contains a special character,
CouchDB will not handle these properly. However authentication of a remote source or target
can be done manually using headers to work around the issue.
+
+ For example this will most likely not work (assuming username "bob@example.com" has password
"password"), even though the URL is properly formatted:
+
+ {{{
+ POST /_replicate HTTP/1.1
+
+ {"source":"https://bob%40example.com:password@example.net:5984/db", "target":"local-db"}
+ }}}
+
+ (In this case a broken CouchBD will encode the username as "bob%40example.com" instead of
"bob@example.com" when submitting authorization to the remote source.)
+
+ To work around the issue, use a JSON hash as follows:
+
+ {{{
+ POST /_replicate HTTP/1.1
+
+ {"source":{"url":"https://example.net:5984/db","headers":{"Authorization":"Basic Ym9iQGV4YW1wbGUuY29tOnBhc3N3b3Jk"}},
"target":"local-db"}
+ }}}
+
+ where the base64 string following the word "Basic" is the output of:
+ {{{
+ echo -n 'bob@example.com:password' | base64
+ }}}
+
+ Using a JSON hash (instead of a plain string) may also be used to specify OAuth (by adding
a "oauth" field to the hash).
+
== Replicator database ==
Since CouchDB 1.1.0, a system database named `_replicator` can be used to manage replications.
Replications triggered by POSTing to /_replicate/ (the old API) are not managed by this system
database.
@@ -138, +167 @@
https://gist.github.com/832610 (from the author)
- http://docs.couchbase.org/couchdb-release-1.1/index.html#couchb-release-1.1-replicatordb
(verifed by the author)
+ http://docs.couchbase.org/couchdb-release-1.1/index.html#couchb-release-1.1-replicatordb
(verifed by the author)
== New features introduced in CouchDB 1.2.0 ==
@@ -195, +224 @@
As for monitoring progress, the active tasks API was enhanced to report additional information
for replication tasks. Example:
{{{
- $ curl http://localhost:5984/_active_tasks
+ $ curl http://localhost:5984/_active_tasks
- [
+ [
- {
+ {
- "pid": "<0.1303.0>",
+ "pid": "<0.1303.0>",
"replication_id": "e42a443f5d08375c8c7a1c3af60518fb+create_target",
- "checkpointed_source_seq": 17333,
+ "checkpointed_source_seq": 17333,
- "continuous": false,
+ "continuous": false,
- "doc_write_failures": 0,
+ "doc_write_failures": 0,
- "docs_read": 17833,
+ "docs_read": 17833,
- "docs_written": 17833,
+ "docs_written": 17833,
- "missing_revisions_found": 17833,
+ "missing_revisions_found": 17833,
- "progress": 3,
+ "progress": 3,
- "revisions_checked": 17833,
+ "revisions_checked": 17833,
- "source": "http://fdmanana.iriscouch.com/test_db/",
+ "source": "http://fdmanana.iriscouch.com/test_db/",
- "source_seq": 551202,
+ "source_seq": 551202,
- "started_on": 1316229471,
+ "started_on": 1316229471,
- "target": "test_db",
+ "target": "test_db",
- "type": "replication",
+ "type": "replication",
- "updated_on": 1316230082
+ "updated_on": 1316230082
- }
+ }
]
}}}
|