You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@couchdb.apache.org by Clare Walsh <cl...@autonomy.com> on 2011/05/17 13:20:01 UTC

Multiple instances on one machine

Hi,
Is there a way to run multiple instance of couch on the same machine, ie 
on different ports?

The only instructions I've been able to find online were for couch 0.8 
and were very out of date... It seems like I would need to make copies 
of most couch folders and the local.ini files, but some of the things it 
refers to either don't exist, have changed/moved or seem like they might 
be the wrong level of nesting :s 
(http://code.google.com/p/couchdb-lounge/wiki/SettingUpTwoCouchInstances)

I'm using couch built from source in the svn trunk (from Friday) and am 
on Ubuntu.
Thanks
Clare


Re: Multiple instances on one machine

Posted by Clare Walsh <cl...@autonomy.com>.
Thanks... turns out that process is the only couch running and is 
listening on 5984 and is my existing couch and not my new shiny copy 
couch...

Turns out that won't start couch if there's already another one running.
When I stopped my other couch and used the given command to start this 
one then it worked... and using the init script I could then start my 
existing couch again, thus having them both run...

Thanks for all the help :)
Clare

On 17/05/11 16:38, Ajai Khattri wrote:
> On Tue, 17 May 2011, Clare Walsh wrote:
>
>> Ah, thank you, I haven't started couch that way before.
>> It says it's started it... but I still can't make requests to it and
>> there are no logs generated.
>> I imagine it's because I'm doing something else stupid?
>>
>> sudo /usr/local/bin/couchdb -a couch.ini
>> Apache CouchDB is running as process 6249, time to relax.
> If you are on Linux, you can run netstat -otap to see what port its
> listening on (if any).
>
>


Re: Multiple instances on one machine

Posted by Ajai Khattri <co...@bitblit.net>.
On Tue, 17 May 2011, Clare Walsh wrote:

> Ah, thank you, I haven't started couch that way before.
> It says it's started it... but I still can't make requests to it and 
> there are no logs generated.
> I imagine it's because I'm doing something else stupid?
> 
> sudo /usr/local/bin/couchdb -a couch.ini
> Apache CouchDB is running as process 6249, time to relax.

If you are on Linux, you can run netstat -otap to see what port its 
listening on (if any).


-- 
Aj.



Re: Multiple instances on one machine

Posted by Clare Walsh <cl...@autonomy.com>.
Ah, thank you, I haven't started couch that way before.
It says it's started it... but I still can't make requests to it and 
there are no logs generated.
I imagine it's because I'm doing something else stupid?

sudo /usr/local/bin/couchdb -a couch.ini
Apache CouchDB is running as process 6249, time to relax.

Thanks
Clare

On 17/05/11 15:04, Owen Marshall wrote:
> On 05/17/2011 10:01 AM, Clare Walsh wrote:
>> sudo /usr/local/etc/init.d/couchdb start -a couch.ini
> I don't think the init.d script looks at argv.
>
> You want to call /usr/local/bin/couchdb directly, not the init script.
>


Re: Multiple instances on one machine

Posted by Owen Marshall <om...@facilityone.com>.
On 05/17/2011 10:01 AM, Clare Walsh wrote:
> sudo /usr/local/etc/init.d/couchdb start -a couch.ini

I don't think the init.d script looks at argv.

You want to call /usr/local/bin/couchdb directly, not the init script.

-- 
Owen Marshall
FacilityONE
http://www.facilityone.com | (502) 805-2126


Re: Multiple instances on one machine

Posted by Clare Walsh <cl...@autonomy.com>.
Thanks Matt,

That all seems to have worked, apart from the actual starting it 
part...  I must be typing the wrong thing, but it's starting and 
stopping my original couchdb instance... my command is below, feel free 
to tell me which bit was completely wrong and made of fail :)

sudo /usr/local/etc/init.d/couchdb start -a couch.ini

(I did try it with -a couch.ini before the start, and also tried it 
without the start but both times it just complained)

Thanks again
Clare

On 17/05/11 14:41, Matt Goodall wrote:
> On 17 May 2011 12:20, Clare Walsh<cl...@autonomy.com>  wrote:
>
>> Hi,
>> Is there a way to run multiple instance of couch on the same machine, ie on
>> different ports?
>>
>> The only instructions I've been able to find online were for couch 0.8 and
>> were very out of date... It seems like I would need to make copies of most
>> couch folders and the local.ini files, but some of the things it refers to
>> either don't exist, have changed/moved or seem like they might be the wrong
>> level of nesting :s (
>> http://code.google.com/p/couchdb-lounge/wiki/SettingUpTwoCouchInstances)
>>
>> I'm using couch built from source in the svn trunk (from Friday) and am on
>> Ubuntu.
>
>
> Hi,
>
> It's definitely possible to run multiple couchdbs on one machine and almost
> everything can be shared if wanted.
>
> Exactly how you set things up really depends on how you want to run your
> server, but I've used the following to start up a new, disposable couchdb
> instance in a local directory for testing:
>
> 1. Create an empty directory; cd to it.
> 2. Create a 'data' directory in the current directory.
> 3. Create the couch.ini file below in the current directory.
> 4. Start couchdb using `/path/to/global/couchdb -a couch.ini`.
>
> --- start of couch.ini ---
> [couchdb]
> database_dir = ./data
> view_index_dir = ./data
> uri_file = couch.uri
>
> [httpd]
> port = 15984
>
> [log]
> file = couch.log
> --- end of couch.ini ---
>
> That actually chains together the two default .ini files, as installed by
> couchdb, and the couch.ini in the current directory. You can use the -c arg
> to couchdb to see the full chain in case you want to customise the .ini
> chain at any level.
>
> Please note that the above should not be considered a "production" setup but
> hopefully it's enough to get you going.
>
> - Matt
>


Re: Multiple instances on one machine

Posted by Matt Goodall <ma...@gmail.com>.
On 17 May 2011 12:20, Clare Walsh <cl...@autonomy.com> wrote:

> Hi,
> Is there a way to run multiple instance of couch on the same machine, ie on
> different ports?
>
> The only instructions I've been able to find online were for couch 0.8 and
> were very out of date... It seems like I would need to make copies of most
> couch folders and the local.ini files, but some of the things it refers to
> either don't exist, have changed/moved or seem like they might be the wrong
> level of nesting :s (
> http://code.google.com/p/couchdb-lounge/wiki/SettingUpTwoCouchInstances)
>
> I'm using couch built from source in the svn trunk (from Friday) and am on
> Ubuntu.



Hi,

It's definitely possible to run multiple couchdbs on one machine and almost
everything can be shared if wanted.

Exactly how you set things up really depends on how you want to run your
server, but I've used the following to start up a new, disposable couchdb
instance in a local directory for testing:

1. Create an empty directory; cd to it.
2. Create a 'data' directory in the current directory.
3. Create the couch.ini file below in the current directory.
4. Start couchdb using `/path/to/global/couchdb -a couch.ini`.

--- start of couch.ini ---
[couchdb]
database_dir = ./data
view_index_dir = ./data
uri_file = couch.uri

[httpd]
port = 15984

[log]
file = couch.log
--- end of couch.ini ---

That actually chains together the two default .ini files, as installed by
couchdb, and the couch.ini in the current directory. You can use the -c arg
to couchdb to see the full chain in case you want to customise the .ini
chain at any level.

Please note that the above should not be considered a "production" setup but
hopefully it's enough to get you going.

- Matt