You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@couchdb.apache.org by Ben <be...@ducktyped.com> on 2008/12/04 07:54:23 UTC

how to change couchdb data dir?

I want to keep my data on a separate partition from the OS. I was 
wondering what ways there are and what you would recommend in terms of 
doing that?

Options I can think of:

1. configure couchdb with certain options (./configue --help shows 
datarootdir and datadir options, but it says they're read-only). I'm a 
bit lost with this option.

2. symlink the data dir. Seems straightforward, are there any pitfalls?

3. Is it possible to configure a per-database data dir, so I can keep my 
app code and data in one place for each app that I have?

Which way would you recommend?

Thanks!
Ben

Re: how to change couchdb data dir?

Posted by Chris Anderson <jc...@apache.org>.
On Wed, Dec 3, 2008 at 10:54 PM, Ben <be...@ducktyped.com> wrote:
> I want to keep my data on a separate partition from the OS. I was wondering
> what ways there are and what you would recommend in terms of doing that?
>

I just set my local.ini with something like:

[couchdb]
database_dir = /path/to/var/lib/couchdb


> 3. Is it possible to configure a per-database data dir, so I can keep my app
> code and data in one place for each app that I have?

Not currently. But the file names inside the data dir are based on the
database name, so if you want that level of control you might use
symlinks.



-- 
Chris Anderson
http://jchris.mfdz.com

Re: how to change couchdb data dir?

Posted by Noah Slater <ns...@apache.org>.
Hey

All of the options listed so far would work:

  * Mounting the default directory as a remote file system.

  * Replacing the default directory with a soft link.

  * Changing the default directory location in the configuration.

  * Using custom ./configure options, this is the same as the last item.

Best,

-- 
Noah Slater, http://tumbolia.org/nslater

Re: how to change couchdb data dir?

Posted by Jan Lehnardt <ja...@apache.org>.
On 4 Dec 2008, at 07:54, Ben wrote:

> I want to keep my data on a separate partition from the OS. I was  
> wondering what ways there are and what you would recommend in terms  
> of doing that?
>
> Options I can think of:
>
> 1. configure couchdb with certain options (./configue --help shows  
> datarootdir and datadir options, but it says they're read-only). I'm  
> a bit lost with this option.

Noah?


> 2. symlink the data dir. Seems straightforward, are there any  
> pitfalls?
>
> 3. Is it possible to configure a per-database data dir, so I can  
> keep my app code and data in one place for each app that I have?
>
> Which way would you recommend?

4. Change dir in local.ini (see default.ini for the setting, use  
local.ini to override).

Cheers
Jan
--

Re: how to change couchdb data dir?

Posted by Richard Heycock <rg...@roughage.com.au>.
Excerpts from Ben's message of Thu Dec 04 17:54:23 +1100 2008:
> I want to keep my data on a separate partition from the OS. I was 
> wondering what ways there are and what you would recommend in terms of 
> doing that?
> 
> Options I can think of:
> 
> 1. configure couchdb with certain options (./configue --help shows 
> datarootdir and datadir options, but it says they're read-only). I'm a 
> bit lost with this option.

Can't you just mount that 'separate' partition over the existing
directory. Using lvm on linux, for example I do the following:

    mount /dev/vg/couchdb /var/lib/couchdb

This does of course assume you are using Linux!

> 2. symlink the data dir. Seems straightforward, are there any pitfalls?

I would assume a sym link would work but if it didn't a bind mount would
certainly work: mount --bind <existing directory> <new directory>.

rgh

> 3. Is it possible to configure a per-database data dir, so I can keep my 
> app code and data in one place for each app that I have?
> 
> Which way would you recommend?
> 
> Thanks!
> Ben