couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dave Cottlehuber <...@jsonified.com>
Subject Re: Multiple Concurrent Instances of CouchDB on Mac OS X 10.7.5
Date Thu, 27 Mar 2014 21:20:30 GMT
On 27 March 2014 18:09, Rian R. Maloney <rian.maloney@yahoo.com> wrote:
> Is there a simple way to run multiple concurrent instances of CouchDB on a single MAC
computer or is it not recommended to do this. I am trying to test multiple client types on
an application w/o requiring multiple PCs.
>
> Thank You
> Rian

All the proposed options are good ones, here's mine:

$ brew install couchdb (or your preferred macbrew/couchdb.app poison)
$ mkdir -p ./lounge/{1,2,3}/{db,view}
$ cd lounge

``` lounge.ini
; per instance settings
[couchdb]
; ensure existing local.ini doesn't get in the way
uuid           =
database_dir   = ./lounge/@/db
view_index_dir = ./lounge/@/view
uri_file       = ./lounge/@/couch.uri

[log]
file = ./lounge/@/couch.log

[httpd]
port = 598@
```

then:

copy lounge.ini into 1,2,3 and replace the @ with the appropriate digit.

.lounge
├── 1/
│   ├── lounge.ini
│   ├── couch.log
│   ├── couch.uri
│   ├── db/
│   └── view/
├── 2/
│   ├── lounge.ini
│   ├── couch.log
│   ├── couch.uri
│   ├── db/
│   └── view/
├── 3/
│   ├── lounge.ini
│   ├── couch.log
│   ├── couch.uri
│   ├── db/
│   └── view/
│
└── lounge.ini

couch.log, couch.uri, couch.pid won't exist until runtime.

use the -c switch to see what config files will be loaded:

$ couchdb -a 1/lounge.ini -c
/usr/local/etc/couchdb/default.ini
/usr/local/etc/couchdb/local.ini
1/lounge.ini

note that you can't get *rid* of default.ini and local.ini from the
normal install. You need to make sure all parameters are overridden in
your lounge.ini files. My sample lounge.ini should have got most of
them. All writes (updates) go into the last file, so this means that
an existing couch install will inherit things like admins from the
defaults if you are not careful.

And run them:

couchdb -i -a 1/lounge.ini -p 1/couch.pid
couchdb -i -a 2/lounge.ini -p 2/couch.pid
couchdb -i -a 3/lounge.ini -p 3/couch.pid
…

You can of course use other options of couchdb here, but this is
sufficient. And I like to see the URLs whizz by in separate terminal
windows.

BTW I didn't do fancy testing, but this looks about right to me.

A+
Dave

Mime
View raw message