I'm trying to sync a database in a local CouchDB installation (v 1.3.1 on a Mac) and a database on Cloudant with master-master replication.
In my local Futon http://localhost:5984/_utils
I've configured Replicator to replicate my local database to Cloudant. Everything works fine replicating from the local database to the Cloudant one, but not backwards. If data changes in the Cloudant's database those changes are not been replicated to my local database.
Local -> Cloudant = works
Cloudant -> Local = doesn't work
Is this possible to be made? Can anyone help?
Thanks!
Finally I figured out that I only needed to configure two replications from my local CouchDB.
Here are both replications:
{
"source":"https://username:[email protected]/cloud_db",
"target":"http://username:pwd@localhost:5985/local_db"
}
{
"source":"http://username:pwd@localhost:5985/local_db",
"target":"https://username:[email protected]/cloud_db"
}
Now, in http://localhost:5984/_utils/status.html
there are two replications running.
Note that I added the username and password to the local connection too. That's because you need to be an authorized user in order to replicate design documents.
Thanks a lot Mike, your answer helped a lot!
Can you try specifying full URLs for both source and target? I think it would look like:
#create the replicator database for your local server
curl -X PUT 'http://127.0.0.1:5984/_replicator'
then upload this document:
{
"source":"https://username:[email protected]/source_db",
"target":"http://127.0.0.1:5985/target_db"
}
Then you should be able to monitor that by a:
http://127.0.0.1:5984/_active_tasks
If that doesn't work for you, can you please copy/paste:
Also, there's a classic 'gotcha' here, that I think you need 'writer' permissions on both the source and target database. That may seem odd, but it's because the replicator is saving checkpoint documents on both the source and the target so that the next time you ask to replicate, it doesn't have to start from scratch.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With