CouchDB backups and cloning the database

后端 未结 5 1618
情歌与酒
情歌与酒 2021-01-30 16:58

We\'re looking at CouchdDB for a CMS-ish application. What are some common patterns, best practices and workflow advice surrounding backing up our production database?

I

5条回答
  •  爱一瞬间的悲伤
    2021-01-30 17:32

    CouchDB replication is horrible. I generally do tar which is much better.

    1. Stop the CouchDB service on the source host
    2. tar.gz the data files.
    3. On my Ubuntu servers this is typically in /var/lib/couchdb (sometimes in a subdirectory based on the Couch version). If you aren’t sure where these files are, you can find the path in your CouchDb config files, or often by doing a ps -A w to see the full command that started CouchDb. Make sure you get the subdirectories that start with . when you archive the files.
    4. Restart the couchdb service on the source host.
    5. scp the tar.gz file to the destination host and unpack them in a temporary location there.
    6. chown the files to the user and group that owns the files already in the database directory on the destination. This is likely couchdb:couchdb. This is important, as messing up the file permissions is the only way I’ve managed to mess up this process so far.
    7. Stop CouchDB on the destination host.
    8. cp the files into the destination directory. Again on my hosts this has been /var/lib/couchdb.
    9. Double check the file permissions in their new home.
    10. Restart CouchDB on the destination host.

提交回复
热议问题