Multiple Concurrent Instances of CouchDB on Mac OS X 10.7.5

144 views
Skip to first unread message

Rian R. Maloney

unread,
Mar 27, 2014, 1:09:20 PM3/27/14
to us...@couchdb.apache.org
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

M.C. Wilson

unread,
Mar 27, 2014, 1:11:58 PM3/27/14
to us...@couchdb.apache.org
Well, if you've got a beefy enough machine I suppose you could use Vagrant to spin up a few CouchDB VMs. I haven't used it, but there appears to be a Couch box for Vagrant over here:
https://github.com/concord-consortium/couchdb-vagrant

Alexander Shorin

unread,
Mar 27, 2014, 1:20:44 PM3/27/14
to us...@couchdb.apache.org
The more lightweight solution would be to use Docker. It already
supports OSX. Just don't forget to update config file and set
different listen port for each instance.
--
,,,^..^,,,

Rian R. Maloney

unread,
Mar 27, 2014, 1:56:50 PM3/27/14
to us...@couchdb.apache.org
Thanks M.C. for the suggestion. It looks like more than I need at this point. A "3 minute startup" indicates far more complexity than running a few more CouchDB processes. I was hoping for something along the lines of copying "Apache CouchDB.app" and creating several ../Application Support/CouchDB folders and updating the various  "Apache CouchDB.app" packages to point to these new folders?

Rian

Dale Harvey

unread,
Mar 27, 2014, 2:02:40 PM3/27/14
to us...@couchdb.apache.org, Rian R. Maloney
I had a little script to configure isolated instances, you should be able
to point 'couchdb' to the couchdb commands inside the .app at a guess

https://github.com/crodjer/pouchdb/blob/36eb513b580d5d1870bde81cfeae6ae51d4611a3/scripts/start_standalone_couch.sh

Ryan Ramage

unread,
Mar 27, 2014, 3:05:46 PM3/27/14
to user
There is also this:

https://github.com/hoodiehq/node-multicouch

Used in hoodie. Not used personally, but probably would find lots of
helpful people around here to help you use it.

Dave Cottlehuber

unread,
Mar 27, 2014, 5:20:30 PM3/27/14
to us...@couchdb.apache.org, Rian R. Maloney
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
Reply all
Reply to author
Forward
0 new messages