Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Permanent continuous replication with CouchDB across reboots

How can I set up continuous replication after reboot? Continuous replication works only until the next reboot.

like image 852
burli Avatar asked Feb 15 '11 18:02

burli


2 Answers

Continuous replication was not postponed to 1.3, it is available as of 1.1. As Dominic said, you use the _replicator database. Stick a doc in there like:

{
    "_id": "my_rep",
    "source":  "http://myserver.com:5984/foo",
    "target":  "bar",
    "create_target":  true,
    "continuous": true
}

For detailed documentation look here: https://gist.github.com/832610

like image 141
Clayton Gulick Avatar answered Nov 15 '22 08:11

Clayton Gulick


Unfortunately, you still need to trigger the continuous replication after a server restart.

However, I asked this question on IRC, and it turns out that v1.1 of CouchDB will most likely include a special database called _replicator that will store replication settings. That way, they will remain even after a server restart.

like image 39
Dominic Barnes Avatar answered Nov 15 '22 08:11

Dominic Barnes