You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@couchdb.apache.org by Dave Cottlehuber <da...@muse.net.nz> on 2010/09/01 03:05:43 UTC

Re: get couchdb to startup with server

Hi Dan

distro is linux speak for version of OS - e.g. desktop ubuntu 10.04
from CD, or ubuntu 10.04 server on Amazon EC2.

You've got 2 separate issues here so let's tackle these 1 by 1. First
up is getting the self-contained couch folder running as your normal
user - not as root. this is both best practice & simpler normally.

the first error is "{{badmatch,{error,eacces}}," which confused me too
when I first started couching. This is a simple access denied one,
probably the ini files causing this.

I whipped up a desktop ubuntu & pulled down the installer from see
what's going on & it worked perfectly for me (nice one Jason@) but I
think this is just permissions issues & path stuff. It is probably
easier to start from scratch so let's do that.

* delete any existing folder called /home/danuser/couchdb-1.0.1
* download either the 32 or 64-bit version as appropriate from
http://www.couch.io/get to your desktop. I'm 64-bit ubuntu 10.04 so
this was http://dl.couchone.com/dl/26f246a0fe23d6a53d5326713308f43c/install-couchdb-1.0.1_rel1-linux-x64.bin
for me.
* make it executable by right-clicking it, select "properties" then
the permissions tab, and tick the "execute" box, then click close.
* open up a terminal
* type the following, followed by a tab to complete the filename:
    ~/Desktop/install-couch
* this should expand into ~/Desktop/install-couchdb-1.0.1_rel1-linux-x64.bin
* press enter to run the installer
* accept the default location which should be
/home/danuser/couchdb-1.0.1 & finish the install wizard
* go back to your File Browser and open up /home/danuser/couchdb-1.0.1/bin
* double-click couchdb & tell it to run in a terminal
* you should get the "Apache CouchDB has started. Time to relax."
message, and can now go to your browser for the futon interface at
http://127.0.0.1:5984/_utils

How do you get on with this?

If you have any issues send back the output from the following
commands in your terminal:

cd ~
uname -a
ls -ld couch*
ls -lR couchdb-1.0.1/var
ls -lR couchdb-1.0.1/etc

& any errors from the terminal windows, or anything in
~/couchdb-1.0.1/var/log/couchdb/

For your next question "how do I run CouchDB at startup" do you mean
when you login, or all the time in the background? The latter is
probably best being built from source, & doing a proper install. I'll
have a fiddle with this in the next few days & get some simple steps
together unless somebody has a better idea.

cheers
Dave

Re: get couchdb to startup with server

Posted by Randall Leeds <ra...@gmail.com>.
On Thu, Sep 2, 2010 at 13:19,  <wh...@aol.com> wrote:
>
> So if my login name is userdan. The original install is in/opt
> And let's say the couchdb master admin is dan.
> What would I change these to from your code??
>
> Thanks
>
>
> sudo adduser --system \
>             --home $COUCHDB_PREFIX/var/lib/couchdb \
>             --no-create-home \
>             --shell /bin/bash \
>             --group --gecos \
>             "CouchDB Administrator" couchdb
>
>
> # ensure that our new user owns it's stuff
> sudo chown -R couchdb:couchdb $COUCHDB_PREFIX/{etc,var/lib,var/run,var/log}/couchdb
>
>
> sudo /etc/init.d/couchdb restart

It's up to you to decide what user you want to run couchdb as.
It's nice to run couchdb as its own user (couchdb) so that, for
example, it doesn't have permission to edit userdan's home directory.
If nothing on your system gives permission to couchdb *except* the
files couchdb has to touch, then couchdb is essentially locked into
the part of your filesystem that it actually needs and the damage
possible in the event of any security exploits will be minimized.

So, you could leave it as above. Or you could skip the adduser if you
already have userdan and put userdan:userdan in the chown command.

-Randall

Re: get couchdb to startup with server

Posted by wh...@aol.com.
So if my login name is userdan. The original install is in/opt 
And let's say the couchdb master admin is dan.
What would I change these to from your code??

Thanks


sudo adduser --system \
             --home $COUCHDB_PREFIX/var/lib/couchdb \
             --no-create-home \
             --shell /bin/bash \
             --group --gecos \
             "CouchDB Administrator" couchdb


# ensure that our new user owns it's stuff
sudo chown -R couchdb:couchdb $COUCHDB_PREFIX/{etc,var/lib,var/run,var/log}/couchdb


sudo /etc/init.d/couchdb restart

 


 

 

-----Original Message-----
From: Sebastian Cohnen <se...@googlemail.com>
To: user@couchdb.apache.org
Sent: Thu, Sep 2, 2010 12:35 pm
Subject: Re: get couchdb to startup with server


I haven't read the whole thread, but have a look at my gist: 

http://gist.github.com/501039



you need to have a couchdb user, and it needs to own its stuff (line 40+ in the 

gist)





Best



Sebastian



On 02.09.2010, at 20:09, whimsica@aol.com wrote:



> Okay I did that and adjust the rc.d. couchdb is on for doing chkconfig

> 

> But...

> 

> I get this boot.log error on startup

> [ OK ]

> * Starting database server couchdb        Apache CouchDB needs write 

permission on the PID file: /opt/couchdb-1.0.1/var/run/couchdb/couchdb.pid

> 

> So how do I set the permissions?

> 

> Thanks for all your help. I feel like I've almost got it working now.

> 

> Dan

> 

> 

> 

> 

> 

> 

> 

> 

> 

> 

> -----Original Message-----

> From: Mikhail A. Pokidko <mi...@gmail.com>

> To: user@couchdb.apache.org

> Sent: Thu, Sep 2, 2010 12:22 am

> Subject: Re: get couchdb to startup with server

> 

> 

> On Thu, Sep 2, 2010 at 10:11 AM,  <wh...@aol.com> wrote:

> 

> 

> 

>> It is working now, but I don't think that installer puts anything in the 

> 

> init.d folder?

> 

> 

> 

> Oh, couchio installer. No, it doesn`t puts to system init.d.

> 

> 

> 

>> Is there something I should drag in there from the installation -- maybe 

> 

> what's in the /opt/couchdb-1.0.1/etc folder?

> 

> 

> 

> Yes, copy /opt/couchdb-1.0.1/etc/init.d/couchdb to /etc/init.d/ and

> 

> check chkconfig again.

> 

> 

> 

>> I don't know what couchio is trying to do but so far this installer with 

10.04 

> 

> has caused a lot of trouble for me.

> 

> 

> 

> Just ask them?)

> 

> 

> 

> -- 

> 

> xmpp: pma AT altlinux DOT org

> 

> 

> 


 

Re: get couchdb to startup with server

Posted by Sebastian Cohnen <se...@googlemail.com>.
I haven't read the whole thread, but have a look at my gist: http://gist.github.com/501039

you need to have a couchdb user, and it needs to own its stuff (line 40+ in the gist)


Best

Sebastian

On 02.09.2010, at 20:09, whimsica@aol.com wrote:

> Okay I did that and adjust the rc.d. couchdb is on for doing chkconfig
> 
> But...
> 
> I get this boot.log error on startup
> [ OK ]
> * Starting database server couchdb        Apache CouchDB needs write permission on the PID file: /opt/couchdb-1.0.1/var/run/couchdb/couchdb.pid
> 
> So how do I set the permissions?
> 
> Thanks for all your help. I feel like I've almost got it working now.
> 
> Dan
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> -----Original Message-----
> From: Mikhail A. Pokidko <mi...@gmail.com>
> To: user@couchdb.apache.org
> Sent: Thu, Sep 2, 2010 12:22 am
> Subject: Re: get couchdb to startup with server
> 
> 
> On Thu, Sep 2, 2010 at 10:11 AM,  <wh...@aol.com> wrote:
> 
> 
> 
>> It is working now, but I don't think that installer puts anything in the 
> 
> init.d folder?
> 
> 
> 
> Oh, couchio installer. No, it doesn`t puts to system init.d.
> 
> 
> 
>> Is there something I should drag in there from the installation -- maybe 
> 
> what's in the /opt/couchdb-1.0.1/etc folder?
> 
> 
> 
> Yes, copy /opt/couchdb-1.0.1/etc/init.d/couchdb to /etc/init.d/ and
> 
> check chkconfig again.
> 
> 
> 
>> I don't know what couchio is trying to do but so far this installer with 10.04 
> 
> has caused a lot of trouble for me.
> 
> 
> 
> Just ask them?)
> 
> 
> 
> -- 
> 
> xmpp: pma AT altlinux DOT org
> 
> 
> 


Re: get couchdb to startup with server

Posted by wh...@aol.com.
Okay I did that and adjust the rc.d. couchdb is on for doing chkconfig

But...

I get this boot.log error on startup
[ OK ]
 * Starting database server couchdb        Apache CouchDB needs write permission on the PID file: /opt/couchdb-1.0.1/var/run/couchdb/couchdb.pid

So how do I set the permissions?

Thanks for all your help. I feel like I've almost got it working now.

Dan

 

 


 

 

-----Original Message-----
From: Mikhail A. Pokidko <mi...@gmail.com>
To: user@couchdb.apache.org
Sent: Thu, Sep 2, 2010 12:22 am
Subject: Re: get couchdb to startup with server


On Thu, Sep 2, 2010 at 10:11 AM,  <wh...@aol.com> wrote:



> It is working now, but I don't think that installer puts anything in the 

init.d folder?



Oh, couchio installer. No, it doesn`t puts to system init.d.



> Is there something I should drag in there from the installation -- maybe 

what's in the /opt/couchdb-1.0.1/etc folder?



Yes, copy /opt/couchdb-1.0.1/etc/init.d/couchdb to /etc/init.d/ and

check chkconfig again.



> I don't know what couchio is trying to do but so far this installer with 10.04 

has caused a lot of trouble for me.



Just ask them?)



-- 

xmpp: pma AT altlinux DOT org


 

Re: get couchdb to startup with server

Posted by "Mikhail A. Pokidko" <mi...@gmail.com>.
On Thu, Sep 2, 2010 at 10:11 AM,  <wh...@aol.com> wrote:

> It is working now, but I don't think that installer puts anything in the init.d folder?

Oh, couchio installer. No, it doesn`t puts to system init.d.

> Is there something I should drag in there from the installation -- maybe what's in the /opt/couchdb-1.0.1/etc folder?

Yes, copy /opt/couchdb-1.0.1/etc/init.d/couchdb to /etc/init.d/ and
check chkconfig again.

> I don't know what couchio is trying to do but so far this installer with 10.04 has caused a lot of trouble for me.

Just ask them?)

-- 
xmpp: pma AT altlinux DOT org

Re: get couchdb to startup with server

Posted by wh...@aol.com.
 No such file or directory...
I don't think there is anything in init.d

Right now couch has been installed in /opt from the couchio installer.
It is working now, but I don't think that installer puts anything in the init.d folder?
Is there something I should drag in there from the installation -- maybe what's in the /opt/couchdb-1.0.1/etc folder?
I don't know what couchio is trying to do but so far this installer with 10.04 has caused a lot of trouble for me.

Thanks,

Dan

 


 

 

-----Original Message-----
From: Mikhail A. Pokidko <mi...@gmail.com>
To: user@couchdb.apache.org
Sent: Wed, Sep 1, 2010 10:14 pm
Subject: Re: get couchdb to startup with server


On Thu, Sep 2, 2010 at 4:39 AM,  <wh...@aol.com> wrote:
> I loaded that chkconfig but it said couchdb is not a service???

$ sudo ls -l /etc/init.d/couchdb
-rwxr-xr-x 1 root root 2999 Jun 28 17:04 /etc/init.d/couchdb
Does the rights look like this?


http://github.com/apache/couchdb/blob/trunk/etc/init/couchdb.tpl.in -
is this your init script?



-- 
xmpp: pma AT altlinux DOT org

 

Re: get couchdb to startup with server

Posted by "Mikhail A. Pokidko" <mi...@gmail.com>.
On Thu, Sep 2, 2010 at 4:39 AM,  <wh...@aol.com> wrote:
> I loaded that chkconfig but it said couchdb is not a service???

$ sudo ls -l /etc/init.d/couchdb
-rwxr-xr-x 1 root root 2999 Jun 28 17:04 /etc/init.d/couchdb
Does the rights look like this?


http://github.com/apache/couchdb/blob/trunk/etc/init/couchdb.tpl.in -
is this your init script?



-- 
xmpp: pma AT altlinux DOT org

Re: get couchdb to startup with server

Posted by wh...@aol.com.
I loaded that chkconfig but it said couchdb is not a service???

Dan

 

 


 

 

-----Original Message-----
From: Mikhail A. Pokidko <mi...@gmail.com>
To: user@couchdb.apache.org
Sent: Tue, Aug 31, 2010 10:13 pm
Subject: Re: get couchdb to startup with server


On Wed, Sep 1, 2010 at 5:26 AM,  <wh...@aol.com> wrote:



> I want couchdb to run from login or restart -- in case a power outage or 

something

> and the server has to restart itself.

> Everything else will start back up -- apache, curl, mysql, everything except 

couchdb.



Did you try chkconfig --add couchdb && chkconfig couchdb on?







-- 

xmpp: pma AT altlinux DOT org


 

Re: get couchdb to startup with server

Posted by "Mikhail A. Pokidko" <mi...@gmail.com>.
On Wed, Sep 1, 2010 at 5:26 AM,  <wh...@aol.com> wrote:

> I want couchdb to run from login or restart -- in case a power outage or something
> and the server has to restart itself.
> Everything else will start back up -- apache, curl, mysql, everything except couchdb.

Did you try chkconfig --add couchdb && chkconfig couchdb on?



-- 
xmpp: pma AT altlinux DOT org

Re: get couchdb to startup with server

Posted by wh...@aol.com.
Thanks for the detailed startup instructions.

What happened is that another version of couch was running at the same time.
Someone from the IRC took the time to help me kill that process and then it worked.
It was still running even after throwing away all the files.

I want couchdb to run from login or restart -- in case a power outage or something
and the server has to restart itself.
Everything else will start back up -- apache, curl, mysql, everything except couchdb.

Thanks

Dan

 

 


 

 

-----Original Message-----
From: Dave Cottlehuber <da...@muse.net.nz>
To: user@couchdb.apache.org
Sent: Tue, Aug 31, 2010 6:05 pm
Subject: Re: get couchdb to startup with server


Hi Dan



distro is linux speak for version of OS - e.g. desktop ubuntu 10.04

from CD, or ubuntu 10.04 server on Amazon EC2.



You've got 2 separate issues here so let's tackle these 1 by 1. First

up is getting the self-contained couch folder running as your normal

user - not as root. this is both best practice & simpler normally.



the first error is "{{badmatch,{error,eacces}}," which confused me too

when I first started couching. This is a simple access denied one,

probably the ini files causing this.



I whipped up a desktop ubuntu & pulled down the installer from see

what's going on & it worked perfectly for me (nice one Jason@) but I

think this is just permissions issues & path stuff. It is probably

easier to start from scratch so let's do that.



* delete any existing folder called /home/danuser/couchdb-1.0.1

* download either the 32 or 64-bit version as appropriate from

http://www.couch.io/get to your desktop. I'm 64-bit ubuntu 10.04 so

this was http://dl.couchone.com/dl/26f246a0fe23d6a53d5326713308f43c/install-couchdb-1.0.1_rel1-linux-x64.bin

for me.

* make it executable by right-clicking it, select "properties" then

the permissions tab, and tick the "execute" box, then click close.

* open up a terminal

* type the following, followed by a tab to complete the filename:

    ~/Desktop/install-couch

* this should expand into ~/Desktop/install-couchdb-1.0.1_rel1-linux-x64.bin

* press enter to run the installer

* accept the default location which should be

/home/danuser/couchdb-1.0.1 & finish the install wizard

* go back to your File Browser and open up /home/danuser/couchdb-1.0.1/bin

* double-click couchdb & tell it to run in a terminal

* you should get the "Apache CouchDB has started. Time to relax."

message, and can now go to your browser for the futon interface at

http://127.0.0.1:5984/_utils



How do you get on with this?



If you have any issues send back the output from the following

commands in your terminal:



cd ~

uname -a

ls -ld couch*

ls -lR couchdb-1.0.1/var

ls -lR couchdb-1.0.1/etc



& any errors from the terminal windows, or anything in

~/couchdb-1.0.1/var/log/couchdb/



For your next question "how do I run CouchDB at startup" do you mean

when you login, or all the time in the background? The latter is

probably best being built from source, & doing a proper install. I'll

have a fiddle with this in the next few days & get some simple steps

together unless somebody has a better idea.



cheers

Dave