i have a central CouchDB Instance which holds one database with my ddoc's and several databases for my data. The reason to put the ddoc's in a separate database resides in the fact that i use the central CouchDB Instance only as a distributer for other CouchDB Instances. Every database which is holding data uses the same ddoc's.
Central Couch: db_customer1 db_customer2 db_ddoc's
CouchDB customer1: db_customer1 + db_ddoc's
CouchDB customer2: db_customer2 + db_ddoc's
Testing
1.) To test the use case i created two databases in my central CouchDB Instance and inserted the appropriate data.
2.) After that i created a second CouchDB Instance and a database.
3.) The next step was to replicate the database with the data to the second CouchDB Instance. That works like a charm.
4.) The last step is now to replicate all the ddoc's. But this fails.
replication document:
{
"_id": "3cd50136342edc1cd9660e29f60148f4",
"_rev": "3-3c058e1f8a2bee8b896719b728b5119b",
"source": "design",
"target": "http://robert:secret@172.17.0.1:5983/kunde_a",
"owner": "robert",
"_replication_state": "completed",
"_replication_state_time": "2016-05-18T10:04:34+02:00",
"_replication_id": "74498297514f19611af3f198e36beb7c",
"_replication_stats": {
"revisions_checked": 0,
"missing_revisions_found": 0,
"docs_read": 0,
"docs_written": 0,
"doc_write_failures": 0,
"checkpointed_source_seq": 13
}
}
CouchDB log from the central CouchDB Instance
Wed, 18 May 2016 08:09:42 GMT] [info] [<0.3840.1>] 127.0.0.1 - - POST /_replicator 201
[Wed, 18 May 2016 08:09:42 GMT] [info] [<0.135.0>] Attempting to start replication `74498297514f19611af3f198e36beb7c` (document `3cd50136342edc1cd9660e29f6014f12`).
[Wed, 18 May 2016 08:09:42 GMT] [info] [<0.4327.1>] Replication `"74498297514f19611af3f198e36beb7c"` is using:
4 worker processes
a worker batch size of 500
20 HTTP connections
a connection timeout of 30000 milliseconds
10 retries per request
socket options are: [{keepalive,true},{nodelay,false}]
source start sequence 13
[Wed, 18 May 2016 08:09:42 GMT] [info] [<0.4327.1>] Document `3cd50136342edc1cd9660e29f6014f12` triggered replication `74498297514f19611af3f198e36beb7c`
[Wed, 18 May 2016 08:09:42 GMT] [info] [<0.4326.1>] starting new replication `74498297514f19611af3f198e36beb7c` at <0.4327.1> (`design` -> `http://robert:*****@172.17.0.1:5983/kunde_a/`)
[Wed, 18 May 2016 08:09:42 GMT] [info] [<0.4327.1>] Replication `74498297514f19611af3f198e36beb7c` finished (triggered by document `3cd50136342edc1cd9660e29f6014f12`)
CouchDB log from the second CouchDB Instance
172.17.0.1 - - HEAD /kunde_a/ 200
[Wed, 18 May 2016 08:04:34 GMT] [info] [<0.5521.0>] 172.17.0.1 - - GET /kunde_a/ 200
[Wed, 18 May 2016 08:04:34 GMT] [info] [<0.5521.0>] 172.17.0.1 - - GET /kunde_a/_local/74498297514f19611af3f198e36beb7c 200
If i first insert the ddoc's and let the replicator create a new database the process completes, but if i then replicate my data database the ddoc's vanish and i have the same problem as before.
If both, ddocs and data, are in one database the replication works flawless.
Any help is welcome :)