The official documentation has moved to http://docs.couchdb.org — The transition is not 100% complete, but http://docs.couchdb.org should be seen as having the latest info. In some cases, the wiki still has some more or older info on certain topics inside CouchDB.

You need to be added to the ContributorsGroup to edit the wiki. But don't worry! Just email any Mailing List or grab us on IRC and let us know your user name.

Setting up Additional CouchDB Instances

While most of the time, it's sufficient to have different applications stored in separate design docs, or in separate DBs, sometimes you just need a separate instance. For example, SSL certificates and port/ip addresses are bound to the erlang instance, not the individual database.

This is the file structure you'll need to create:

    couchdb
    ├── etc
    │   └── couchdb
    │       └── local.ini
    └── var
        ├── lib
        │   └── couchdb
        ├── log
        │   └── couchdb
        └── run
            └── couchdb

% OLD=/usr/local
% NEW=/tmp/couchdb

% mkdir -p $NEW/etc/couchdb/
% mkdir -p $NEW/var/{lib,log,run}/couchdb/

% cp $OLD/etc/couchdb/local.ini $NEW/etc/couchdb/

% tree -l $NEW
[...tedious output omitted...]

[couchdb]
database_dir = /tmp/couchdb/var/lib/couchdb
view_index_dir = /tmp/couchdb/var/lib/couchdb
uri_file = /tmp/couchdb/var/run/couchdb/couch.uri

[httpd]
port = 5985
bind_address = 0.0.0.0

[log]
file = /tmp/couchdb/var/log/couchdb/couch.log

You can test this by running couchdb (in my case interactively using -i):

% couchdb -i -a /tmp/couchdb/etc/couchdb/local.ini

And Relax.

Caveats

The original local.ini is still included in the configuration chain. You can see this by running:

% couchdb -i -a /tmp/couchdb/etc/couchdb/local.ini -c

/usr/local/etc/couchdb/default.ini
/usr/local/etc/couchdb/local.ini
/tmp/couchdb/etc/couchdb/local.ini

This means anything (for example server admins (in [admins] or SSL certificates in [ssl]) that are not over-ridden in your newer config file will apply. If you've got server admins created then don't forget to prune them in the duplicated local.ini if needed.

Additional_Instances (last edited 2012-04-19 09:53:16 by DaveCottlehuber)