For most embedded applications a requirement is a database to store documents, settings, etc. A most powerful NoSql database is CouchDB, developed using the high performance language Erlang. I’ve selected this database for my application because it is a document based database with revision and it is capable to use fewer resources. To install it on your Fox Board, you can see the follow instructions.
-
Step 1: install prerequisites
As usual before you start, you must install all prerequisites:
debarm:~$ sudo aptitude update debarm:~$ sudo aptitude install build-essential debarm:~$ sudo aptitude install libssl-dev zlib1g zlib1g-dev lsb-base debarm:~$ sudo aptitude install ncurses-dev libncurses-dev debarm:~$ sudo aptitude install unixodbc unixodbc-dev xsltproc debarm:~$ sudo aptitude install libmozjs-dev libmozjs2d libicu-dev libcurl-dev
-
Step 2: install Erlang
The next step is easy:
debarm:~$ sudo aptitude install erlang
-
Step 3: install CouchDB
The Debian CouchDB package is older, then you install the latest revision compiling the source code.
Download the source code:debarm:~$ cd /usr/local/src debarm:~$ wget http://it.apache.contactlab.it/couchdb/releases/1.2.0/apache-couchdb-1.2.0.tar.gz
Unpacking it:
debarm:~$ sudo tar xzvf apache-couchdb-1.2.0.tar.gz
Compile it (be patient!):
debarm:~$ cd apache-couchdb-1.2.0 debarm:~$ sudo ./configure --prefix=/ debarm:~$ sudo make && sudo make install
-
Step 4: add CouchDB user and set permissions
As usual it is appropriate to use a specific user for a new service:
debarm:~$ sudo adduser --system --home /var/lib/couchdb --no-create-home --shell /bin/bash --group --gecos 'CouchDB Administrator' couchdb
Now you can assign the right permissions
debarm:~$ sudo chown -R couchdb:couchdb /etc/couchdb debarm:~$ sudo chown -R couchdb:couchdb /var/lib/couchdb debarm:~$ sudo chown -R couchdb:couchdb /var/log/couchdb debarm:~$ sudo chown -R couchdb:couchdb /var/run/couchdb debarm:~$ sudo chown -R couchdb:couchdb /etc/init.d/couchdb debarm:~$ sudo chmod 0770 /etc/couchdb debarm:~$ sudo chmod 0770 /var/lib/couchdb debarm:~$ sudo chmod 0770 /var/log/couchdb debarm:~$ sudo chmod 0770 /var/run/couchdb
-
Step 5: start the service
To start the couchdb when you start your Fox Board, you simply type:
debarm:~$ sudo update-rc.d couchdb defaults
whereas to stop it:
debarm:~$ sudo /etc/init.d/couchdb stop
and to start it again:
debarm:~$ sudo /etc/init.d/couchdb start
-
Step 6: test CouchDB
If your service is started and you type:
debarm:~$ curl http://localhost:5984
you can see:
{"couchdb":"Welcome","version":"1.2.0"}
Ok: your CouchDB is ready! Read CouchDB official documentation to work with it.
Reference: http://www.freshblurbs.com/install-couchdb-debian-squeeze-source
UPDATE. If you have updated your Debian Squeeze to Wheeze following my guide you can install CouchDB 1.2.0 simply typing:
debarm:~# aptitude update debarm:~# aptitude install couchdb
CouchDB , Fox Board
About Marcello Gesmundo
I'm the founder of Yoovant company. I'm an engineer and an artist: what could be better than combine the technologies with the arts?
Hi Marcello,
Your blog is a wonderful resource for those using Acme products — thanks for taking the time to write it!
How did you find performance and memory usage of Couch on the G20? We’d love to use it on our Aria G25-based product.
Thx.
-marc
Hi Marc,
to see memory usage of CouchDB simply use htop from your console: it is very little!
Thank you.
Marcello
Hi, great tutorial
Any future plan for a MongoDB installation on AriaG25 or fox board?
Regards,
Vitor
Hi Vitor,
MongoDB is a great NOSQL database, but it requires more resources than CouchDB. Our partner [Acme Systems](http://www.acmesystems.it) has developed the new [Acqua Board A5](http://www.acmesystems.it/acqua) with a math coprocessor. This new board is more powerful than Aria: it can [play Doom game](http://www.youtube.com/watch?v=50xcpdJhyI4)! Whit this board I want use MongoDB and I’ve developed a brand new product: feel free to visit us at Atmel booth during the [Embedded World 2014](http://www.embedded-world.de/en/) for more informations about this product!
Best regards.
Marcello
Mongo is a little more involved as the main branch of Mongo doesn’t support ARMHF.
There’s a port here:
https://github.com/wtfuzz/mongo-arm
But I’ve had trouble compiling it on my own ARM-based system (not Aria G25) — YMMV.
-marc