5

I have a CouchDB I'd like to replicate to another server in order to do backup dumps without taxing the production server. The production CouchDB has a varying number of databases and I'd like to sync everything and not worry about how many DBs are actually currently on the server.

Now the problem is that the GUI only allows you to configure replication for each DB individually (the same is for http requests). So far I've found various scripts and workarounds (this one looks like my best option so far: https://gist.github.com/janoskk/339d76a40b63969ea568) but no official support for this.

Is It possible that a database designed for syncing multiple servers doesn't have a sync all option?

Tommy Burazin
  • 53
  • 1
  • 6

2 Answers2

6

unfortunately, there is no sync all option. The possibilities you have are:

  • create a replication for each database in the replicator database
  • use a script like you found in your original question (did not test it)
  • copy all the .couch files from system a to b
  • wait for CouchDB 2.0 what will support clustering

;-)

I hope one of these solutions will get the job done. You are also welcome to join the mailinglist for any questions. Please see https://couchdb.apache.org/. user@ or dev@ is the choice you want.

awenkhh
  • 196
  • 4
  • I've gone for options 2 and 4. The script works perfectly, and will be running once daily from the secondary server, after which a dump will be initiated. I really hope v2.0 comes out soon and fixes this. Thanks awenkhh – Tommy Burazin Sep 02 '15 at 11:02
  • How do we create replicate after running the script for new database created? – WSM Jul 31 '16 at 14:00
  • @WSM you have to create the replication documents in the _replicator database by hand ... so in my above list it's step 1 – awenkhh Aug 03 '16 at 12:29
  • Yeah i know that already. Its just that i want to avoid having to create _replicate document manually, but detect new database creation automatically and create _replicate doc automatically as well. – WSM Aug 04 '16 at 00:33
0

I just released a new tool called replicate-couchdb-cluster, which provides a fault tolerant way of replicating an entire cluster of DBs. It also allows for concurrency so it can greatly speed up the time it takes to replicate a cluster.

There is also a docker image that you can use to easily set up a continuous replication.

I hope this helps!

redgeoff
  • 181
  • 6
  • Hi @redgeoff, thanks for the link. I'm no longer on this project so I can't give you any feedback :( Will keep in mind if I need to work with CouchDB again. – Tommy Burazin Aug 02 '17 at 10:59