开发者

How do I change the database file location for couchdb?

I've got couchdb installed from a package manager (Ubuntu, 10.04), but the partition where couchdb is installed is not especially big (~5GB). I'd like to move the database files to a bigger partition I set aside 开发者_StackOverflow社区for the db, but I can't seem to find how to do it anywhere.

I suspect it's a local.ini tweak, but I've got nothing to back that up.


That is in local.ini

[couchdb]
database_dir = /path/to/the/databases
view_index_dir = /path/to/the/views

Good luck!


You could also take advantage of symbolic linking. Move the contents of /var/lib/couchdb into your desired directory, and create a symbolic link. Be sure to give the couchdb user permissions to the symlink.


Here is the documentation for Couchdb 3.2.2:

https://docs.couchdb.org/en/3.2.2-docs/config/intro.html

Here is what worked for me in Ubuntu:

  1. Stop the couchdb service

    sudo service couchdb stop

  2. Modify the default.ini file

    sudo vi /opt/couchdb/etc/default.ini

Lines to modify:

[couchdb]
database_dir = {new location}
view_index_dir = {new location}
  1. Copy the data

sudo rsync -av /opt/couchdb/data/ {new location}

  1. Restart and check the service

    sudo service couchdb start

    sudo service couchdb status

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜