incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dave Cottlehuber <>
Subject Re: Running a dev instance of Couch
Date Thu, 19 Apr 2012 08:46:42 GMT
On 18 April 2012 19:10, Heather Airoldi <> wrote:
> Running locally is what we had currently been doing for testing.  However, we felt the
need to be able to test on our actual server since the configuration (SSL, etc.) and performance
are quite different there than on my local machine.
>  I think the best option will be Dave's suggestion to install a second instance with
a modified ./configure.  A second DB on the same instance may also work but the challenge
is that we are creating new databases frequently, and our CouchApp has a page for users to
select which database to load data from but we don't want databases we create while testing
to show up there.  There are ways to exclude those databases from the list, but I thought
it might be cleaner to have all test data and code in a separate space.
> I think I'll look into the ./configure options and see how much code I'd need to change
to run everything in "dev" mode on a second instance.  Duplicating the server is not an option
> Thanks for your input everyone.
> -Heather
> ________________________________________
> From: Robert Newson []
> Sent: Wednesday, April 18, 2012 12:50 PM
> To:
> Subject: Re: Running a dev instance of Couch
> Why not run locally? I always 'make dev && ./utils/run' on my machine.
> B.
> On 18 April 2012 17:33, Mark Hahn <> wrote:
>> I recommend that you duplicate the server.  On amazon that takes only
>> minutes.  Then release is a simple rcp command.
>> This is the simplest and safest solution.

Hi Heather,

Actually you don't even need to run configure again, couch can share
the same binaries. I had this in the back of my mind but it didn't
make it to the keyboard before send. As penance here's a full recipe:

# adapt as reqd

# chown as reqd for additional user, couch needs r/w to all of the following:
mkdir -p $NEW/etc/couchdb/
mkdir -p $NEW/var/{lib,etc,run}/couchdb/

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

The layout will look like this:
├── /tmp/couchdb/etc
│   └── /tmp/couchdb/etc/couchdb
│       └── /tmp/couchdb/etc/couchdb/local.ini
└── /tmp/couchdb/var
    ├── /tmp/couchdb/var/lib
    │   └── /tmp/couchdb/var/lib/couchdb
    ├── /tmp/couchdb/var/log
    │   └── /tmp/couchdb/var/log/couchdb
    └── /tmp/couchdb/var/run
        └── /tmp/couchdb/var/run/couchdb

You then need to adapt the local.ini file to use these, and obviously
a different port/bind_address combo. I used:

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

port = 5985
bind_address =

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

Finally, run couchdb (in my case interactively using -i):

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

& you're done.

Caveat, if you've got admins created then don't forget to prune them
in the duplicated local.ini if needed.


View raw message