Professional Documents
Culture Documents
Installing and Configuring CouchDB My Life With Pi
Installing and Configuring CouchDB My Life With Pi
08/02/13
My Life With Pi
Living and Working with Raspberry Pi's
Buy It
Build it
Configure it
Use it
Program it
Search
Search
CouchDB is a database that uses JSON for documents, JavaScript for MapReduce
queries, and regular HTTP for an API
UPDATE: See the addendum at the bottom of the page for a full update of how to get
couchdb running after reboot. You still need to follow these instructions, then pop down
Recent Posts
I struggled with this several times, until a colleague of mine called Stephen Lock
showed me the light, so shout out to him for showing me how to make it work post
install.
sudo apt-get install couchdb
UPDATE: The latest version no longer fails and you end up with the last view lines of
you console looking like
[ ok ] Starting database server: couchdb.
Setting up wwwconfig-common (0.2.2) ...
Setting up javascript-common (7) ...
Setting up libsctp1 (1.0.11+dfsg-2) ...
Setting up lksctp-tools (1.0.11+dfsg-2) ...
Processing triggers for menu ...
If you do get an error, then its probably the problem reported in at the bottom of this
blog, but now we can just continue by making sure couch is binding to the correct IP
address so we can connect to it from another machine
cd /etc/couchdb
sudo vi local.ini
To change the bind_address to the address of the machine you are installing on, look
for the following line
;bind_address = 127.0.0.1
Remove the ; from the beginning and then change the ip address to the address of the
server on which couch is installed. Finall restart the couchdb service
/etc/init.d/couchdb restart
This time youll see the following line which signifies Couch is up and running
[ ok ] Starting database server: couchdb.
Recent Comments
Jon "maddog" Hall on Building Colossus
II ?
Parallel Programming with Python - The
Basics My Life With Pi on Parallel
Programming in Python
keith on Parallel Processing on a Pi
it works !
apaik on Parallel Processing on a Pi
it works !
Tobias on Installing and configuring
CouchDB
Archives
January 2013
October 2012
September 2012
August 2012
Categories
Configuration
Development
Hardware/Peripherals
To check its all working, open a browser and enter the url http://hostname:5984 and
youll see a single line of text along the lines of
Learning
Python
{"couchdb":"Welcome","version":"1.2.0"}
We can then bring up the admin console by entering in a browser, the url
http://www.myraspberrypi.info/?p=315
Raspberry Pi
Super Computer
1/4
08/02/13
Uncategorized
If install fails
Unrelated
When this is finished it will probably report an error that it couldnt start couch. Typically
the install will finish with the following lines
Blogroll
Dont panic !, we just need to do some jiggery-pokery to set the permissions and ip
addresses that couch uses. First we need to make sure that couch owns the right
folders which are not set correctly during install
MagPi issue 9
New York Times article and video
Red Pi at night
Then we need to make sure couch is binding to the correct IP address so we can
connect to it from another machine
cd /etc/couchdb
sudo vi local.ini
To change the bind_address to the address of the machine you are installing on, look
for the following line
;bind_address = 127.0.0.1
Remove the ; from the beginning and then change the ip address to the address of the
server on which couch is installed. Finall restart the couchdb service
/etc/init.d/couchdb start
This time youll see the following line which signifies Couch is up and running
[ ok ] Starting database server: couchdb.
To check its all working, open a browser and enter the url http://hostname:5984 and
youll see a single line of text along the lines of
{"couchdb":"Welcome","version":"1.2.0"}
We can then bring up the admin console by entering in a browser, the url
http://hostname:5984/_utils which will show something like this
http://www.myraspberrypi.info/?p=315
2/4
08/02/13
Addendum
Ive had problems with couchdb starting because of permissions and searching the
internet shows this to be a common bug with the current version and is because
/var/run/couchdb has its permissions set back to root after reboot. The easiet way to fix
this for now is to modiy rc.local and make it reset the permissions on startup
sudo vi /etc/init.d/couchdb
And look for the method that starts with the following at about line 84
start_couchdb () {
2 comments
keith
2 Responses
Lu says:
Thanks, it works. You may could add a hint after /etc/init.d/couchdb start pointing to
the Addendum.
Great blog
October 22, 2012 at 6:51 pm
Reply
Tobias says:
You can also put the permission fixing in /etc/default/couchdb by adding these lines to
http://www.myraspberrypi.info/?p=315
3/4
08/02/13
that file:
mkdir -p $RUN_DIR
chown couchdb $RUN_DIR -R
December 1, 2012 at 1:43 pm
Reply
Leave a Comment
Your email address will not be published. Required fields are marked *
Name *
Email *
Website
Comment
Send Comment
http://www.myraspberrypi.info/?p=315
4/4