You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@couchdb.apache.org by Wayne Conrad <wc...@yagni.com> on 2011/01/01 23:18:55 UTC

Multiple couchdb servers, same box

Hello.  I'm trying to start a second couchdb server on a box which 
already has one running, but the second one will not accept 
connections.  However, if I stop the first one before starting the 
second one, it _does_ accept connections.

For the second instance, I'm tacking on another .ini file to override 
the obvious things: port, log location, database directory, &c.  I'll 
bet I missed something.  What should I look for?

Versions:

     Debian Testing ("squeeze")
     Couchdb 0.11.0-2.3 (the -2.3 bit is Debian bookkeeping)
     When I run erl, it says: Erlang R14A (erts-5.8) [source] [smp:2:2] 
[rq:2] [async-threads:0] [kernel-poll:false]

The command line to start the second couchdb:

     sudo couchdb -a /tmp/second.ini

The contents of /tmp/second.ini

     [couchdb]
     database_dir = /tmp/second
     view_index_dir = /tmp/second

     [httpd]
     port = 1024
     bind_address = 127.0.0.1

     [log]
     file = /tmp/second.log

The config files in /etc/couchdb are "stock", as they come when Debian 
installed the package.  Couchdb is binding to port 5984.  I'll not 
include those config files in this already longish post.  If you need to 
see all or part of them, just ask.

Here's what it looks like when the second couchdb doesn't work (because 
the first couchdb is running):

     # Start the first couchdb
     $ sudo /etc/init.d/couchdb start
     Starting database server: couchdb.

     # Start the second one
     $ sudo couchdb -a /tmp/second.ini
     Apache CouchDB is running as process 13405, time to relax.

     # Get the list of databases (fail)
     $ wget http://localhost:1024/_all_dbs
     --2011-01-01 15:01:23--  http://localhost:1024/_all_dbs
     Resolving localhost... 127.0.0.1
     Connecting to localhost|127.0.0.1|:1024... failed: Connection refused.

Here's what it looks like when the second couchdb works (because the 
first couchdb is stopped):

     # Stop the first couchdb
     $ sudo /etc/init.d/couchdb stop
     Stopping database server: couchdb.

     # Start the second one & background it
     $ sudo couchdb -a /tmp/second.ini
     Apache CouchDB 0.11.0 (LogLevel=info) is starting.
     Apache CouchDB has started. Time to relax.
     [info] [<0.31.0>] Apache CouchDB has started on http://127.0.0.1:1024/
     ^Z
     [1]+  Stopped                 sudo couchdb -a /tmp/second.ini
     $ bg
     [1]+ sudo couchdb -a /tmp/second.ini &

     # Get the list of databases (ok)
     $ wget -q -O - http://localhost:1024/_all_dbs
     []
     [info] [<0.211.0>] 127.0.0.1 - - 'GET' /_all_dbs 200


Re: Multiple couchdb servers, same box

Posted by Wayne Conrad <wc...@yagni.com>.
Aha, that's it.  Thanks!

On 01/01/2011 03:37 PM, Randall Leeds wrote:
> Use a different pid file. I think the option is -p on the command line.
> On Jan 1, 2011 5:20 PM, "Wayne Conrad"<wc...@yagni.com>  wrote:
>    
>> Hello. I'm trying to start a second couchdb server on a box which
>> already has one running, but the second one will not accept
>> connections. However, if I stop the first one before starting the
>> second one, it _does_ accept connections.
>>      


Re: Multiple couchdb servers, same box

Posted by Randall Leeds <ra...@gmail.com>.
Use a different pid file. I think the option is -p on the command line.
On Jan 1, 2011 5:20 PM, "Wayne Conrad" <wc...@yagni.com> wrote:
> Hello. I'm trying to start a second couchdb server on a box which
> already has one running, but the second one will not accept
> connections. However, if I stop the first one before starting the
> second one, it _does_ accept connections.
>
> For the second instance, I'm tacking on another .ini file to override
> the obvious things: port, log location, database directory, &c. I'll
> bet I missed something. What should I look for?
>
> Versions:
>
> Debian Testing ("squeeze")
> Couchdb 0.11.0-2.3 (the -2.3 bit is Debian bookkeeping)
> When I run erl, it says: Erlang R14A (erts-5.8) [source] [smp:2:2]
> [rq:2] [async-threads:0] [kernel-poll:false]
>
> The command line to start the second couchdb:
>
> sudo couchdb -a /tmp/second.ini
>
> The contents of /tmp/second.ini
>
> [couchdb]
> database_dir = /tmp/second
> view_index_dir = /tmp/second
>
> [httpd]
> port = 1024
> bind_address = 127.0.0.1
>
> [log]
> file = /tmp/second.log
>
> The config files in /etc/couchdb are "stock", as they come when Debian
> installed the package. Couchdb is binding to port 5984. I'll not
> include those config files in this already longish post. If you need to
> see all or part of them, just ask.
>
> Here's what it looks like when the second couchdb doesn't work (because
> the first couchdb is running):
>
> # Start the first couchdb
> $ sudo /etc/init.d/couchdb start
> Starting database server: couchdb.
>
> # Start the second one
> $ sudo couchdb -a /tmp/second.ini
> Apache CouchDB is running as process 13405, time to relax.
>
> # Get the list of databases (fail)
> $ wget http://localhost:1024/_all_dbs
> --2011-01-01 15:01:23-- http://localhost:1024/_all_dbs
> Resolving localhost... 127.0.0.1
> Connecting to localhost|127.0.0.1|:1024... failed: Connection refused.
>
> Here's what it looks like when the second couchdb works (because the
> first couchdb is stopped):
>
> # Stop the first couchdb
> $ sudo /etc/init.d/couchdb stop
> Stopping database server: couchdb.
>
> # Start the second one & background it
> $ sudo couchdb -a /tmp/second.ini
> Apache CouchDB 0.11.0 (LogLevel=info) is starting.
> Apache CouchDB has started. Time to relax.
> [info] [<0.31.0>] Apache CouchDB has started on http://127.0.0.1:1024/
> ^Z
> [1]+ Stopped sudo couchdb -a /tmp/second.ini
> $ bg
> [1]+ sudo couchdb -a /tmp/second.ini &
>
> # Get the list of databases (ok)
> $ wget -q -O - http://localhost:1024/_all_dbs
> []
> [info] [<0.211.0>] 127.0.0.1 - - 'GET' /_all_dbs 200
>