Goal

Gumstix, like BeagleBoard, is an embedded platform. I want to run CouchDB on it.

Building CouchDB on Gumstix

STATUS:

  • Native build: Works!
  • Cross-compile build: haven't tested. See the resources section at the bottom. Looks "simple" enough.

Native Installation

We'll start by building on ARM and later move to a bitbake recipe (if it's possible for me to create one).

opkg install task-sdk-native

nspr sudo opkg install libgnutls26 icu icu-dev curl curl-dev

erlang

USER=root
GUMSTIX=192.168.1.10

cd ~/overo-oe
bitbake erlang
scp ./tmp/deploy/glibc/ipk/armv7a/erlang-libs_*_armv7a.ipk ${USER}@${GUMSTIX}:~/
scp ./tmp/deploy/glibc/ipk/armv7a/erlang_*_armv7a.ipk ${USER}@${GUMSTIX}:~/

On the overo

sudo opkg install ~/erlang*

CouchDB

About 15 mins. Installs executable to /usr/local

wget http://www.ecoficial.com/apachemirror//couchdb/1.0.1/apache-couchdb-1.0.1.tar.gz
tar xf apache-couchdb-1.0.1.tar.gz
cd apache-couchdb-1.0.1
./configure
make && sudo make install

Then configuration

cd ~/
sudo su -

adduser couchdb
vim /etc/passwd
chown couchdb:couchdb /usr/local/var/lib/couchdb/

chown -R couchdb: /usr/local/var/*/couchdb /usr/local/etc/couchdb
chmod 0770 /usr/local/var/*/couchdb
chmod 664 /usr/local/etc/couchdb/*.ini
chmod 775 /usr/local/etc/couchdb/*.d

cd /etc/init.d
ln -s /usr/local/etc/init.d/couchdb couchdb

update-rc.d couchdb defaults

/etc/init.d/couchdb start
ping -c 1 127.0.0.1 # just to make sure that you haven't misconfigured `/etc/networking/interfaces` ... I have
curl http://127.0.0.1:5984/
# {"couchdb":"Welcome","version":"1.0.1"}

# run test suite in firefox at http://127.0.0.1:5984/_utils/couch_tests.html?script/couch_tests.js

Admin Party!!!!

Yes, party because it's working.

Yes, go into the browser and set a password.

http://${GUMSTIX}:5984/_utils

Replication

I also have an account on couchone.com which uses http authentication.

To replicate the database I:

  • create a new database on my gumstix
  • secure it by selecting both one admin and one reader
  • replicate it by entering the remote as http://USER:PASSWORD@mydb.couchone.com
  • selecting the name of my local database

Resources

Appendix

nspr is not available through the Angstrom repository. It can be bitbaked.

USER=root
GUMSTIX=192.168.1.110

cd ~/overo-oe
bitbake nspr
scp ./tmp/deploy/glibc/ipk/armv7a/nspr_*-*_armv7a.ipk ${USER}@${GUMSTIX}:~/
scp ./tmp/deploy/glibc/ipk/armv7a/nspr-dev_*-*_armv7a.ipk ${USER}@${GUMSTIX}:~/
scp ./tmp/deploy/glibc/ipk/armv7a/nspr-static_*-*_armv7a.ipk ${USER}@${GUMSTIX}:~/

sudo opkg install ~/nspr_*.ipk

Errors

Missing nspr components - try installing from source rather than bitbake

In file included from jsatom.h:53,
                 from jsapi.c:57:
jslock.h:45:20: error: pratom.h: No such file or directory
jslock.h:46:20: error: prlock.h: No such file or directory
jslock.h:47:20: error: prcvar.h: No such file or directory
jslock.h:48:22: error: prthread.h: No such file or directory
In file included from jsatom.h:53,
                 from jsapi.c:57:
[HUGE NUMBER OF ERRORS OMITTED HERE]
jsapi.c: In function 'JS_NewStringCopyZ':
jsapi.c:5251: error: 'JSRuntime' has no member named 'emptyString'
jsapi.c: In function 'JS_NewUCStringCopyZ':
jsapi.c:5293: error: 'JSRuntime' has no member named 'emptyString'
make[1]: *** [Linux_All_OPT.OBJ/jsapi.o] Error 1
make: *** [all] Error 2

Missing nspr and SpiderMonkey

configure: error: Could not find the js library.

Is the Mozilla SpiderMonkey library installed?

Missing ICU

checking for icu-config... no
*** The icu-config script could not be found. Make sure it is
*** in your path, and that taglib is properly installed.
*** Or see http://ibm.com/software/globalization/icu/
configure: error: Library requirements (ICU) not met.

Missing link to libicuuc.so

checking for icu-config... /usr/bin/icu-config
### icu-config: Can't find /usr/lib/libicuuc.so - ICU prefix is wrong.
###      Try the --prefix= or --exec-prefix= options 
### icu-config: Exitting.
checking for ICU >= 3.4.1... expr: syntax error
can't find ICU >= 3.4.1
configure: error: Library requirements (ICU) not met.

Missing curl-dev

checking for curl-config... 

Missing icu-dev

unicode/ucol.h

Missing gnutls

gcc: /usr/lib/.libs/libgnutls.so: No such file or directory

Was this useful to you? Share it!




blog comments powered by Disqus

Published

2010-10-07

Categories


Tags