2
votes

We are using CouchDB 2.0 for storing files (.txt, .doc, .xls, .pdf, .mp3, .mp4, .zip). Files are uploaded and stored on CouchDB from our web application. Maximum upload size for a file being uploaded is 500 MB.

We want to backup CouchDB on regular basis from production server to backup server machine having CouchDB installed. We are using replication technique supported by CouchDB for backing up the data.

Following curl command works for replicating database:

curl -H "Content-Type: application/json" -X POST "http://localhost:5984/_replicate" -d {"source":"http://user:password@targetIP:5984/dbname","target":"sampledb","continuous":true} 

Above command works well for replicating database that has all documents with text file attachments. But it does not work for database having documents with video or audio or pdf files as attachments.

Here are details about this problem - If a text file upto 500MB size is uploaded on CouchDB, it gets stored with compressed size much lesser than 500MB. And if CouchDB has only text files stored, replication works well without any problem. But if any media file, pdf or zip file is uploaded on CouchDB, it gets stored but without any compression, and CouchDB with these files does not replicate successfully. This typically happens when media files with more than 5mb are uploaded.

As a work around, we added video/* in compressible_types option from default.ini file. But still replicating db with documents having media attachment doesn't work.

Does anyone know about how to replicate CouchDB in such a case?

Any help is really appreciable.

Thanking you,

Jaqen H'ghar

2

2 Answers

2
votes

This issue is solved by adding following option in local.ini settings file for couchDB. This file is present at location CouchDB\etc.

[fabric] request_timeout = infinity

0
votes

If you want to make a backup you can simply stop one CouchDB node (assuming it's clustered) and create a copy of the database directory. So wherever database_dir points to in local.ini file.

This is most suitable for creating a backup of one node for restoring one node. So each node should have its own backup.